public function listAction()
    {
        $filterManager = $this->get('phlexible_message.filter_manager');

        $filters = [];

        foreach ($filterManager->findBy(['userId' => $this->getUser()->getId()]) as $filter) {
            $criteria = [];
            foreach ($filter->getCriteria() as $groupIndex => $group) {
                foreach ($group as $criterium) {
                    $criteria[] = [
                        'criteria' => $criterium->getType(),
                        'value' => $criterium->getValue(),
                        'group' => $groupIndex + 1,
                    ];
                }
            }

            $filters[] = [
                'id' => $filter->getId(),
                'title' => $filter->getTitle(),
                'criteria' => $criteria,
            ];
        }

        return new JsonResponse($filters);
    }