Added new endpoint for API: config

This commit is contained in:
Nicolas Lœuillet
2022-03-15 10:18:28 +01:00
committed by Jeremy Benoist
parent 88fd7afeb5
commit bb12538fab
3 changed files with 77 additions and 0 deletions

View File

@ -0,0 +1,23 @@
<?php
namespace Wallabag\ApiBundle\Controller;
use Nelmio\ApiDocBundle\Annotation\ApiDoc;
use Symfony\Component\HttpFoundation\JsonResponse;
class ConfigRestController extends WallabagRestController
{
/**
* Retrieve configuration for current user.
*
* @ApiDoc()
*
* @return JsonResponse
*/
public function getConfigAction()
{
$this->validateAuthentication();
return $this->sendResponse($this->getUser()->getConfig());
}
}