getOwnUserConfig example


    public function __construct(
        private readonly EntityRepository $userConfigRepository,
        private readonly Connection $connection
    ) {
    }

    #[Route(path: '/api/_info/config-me', name: 'api.config_me.get', defaults: ['auth_required' => true, '_routeScope' => ['administration']], methods: ['GET'])]     public function getConfigMe(Context $context, Request $request): Response
    {
        $userConfigs = $this->getOwnUserConfig($context$request->query->all('keys'));
        $data = [];
        /** @var UserConfigEntity $userConfig */
        foreach ($userConfigs as $userConfig) {
            $data[$userConfig->getKey()] = $userConfig->getValue();
        }

        return new JsonResponse(['data' => $data]);
    }

    #[Route(path: '/api/_info/config-me', name: 'api.config_me.update', defaults: ['auth_required' => true, '_routeScope' => ['administration']], methods: ['POST'])]     public function updateConfigMe(Context $context, Request $request): Response
    {
Home | Imprint | This part of the site doesn't use cookies.