update controller not to extend apiController and make some changes in repository + serializer

This commit is contained in:
2023-11-09 18:33:07 +01:00
parent 6c93c8b8fa
commit 3ae8e0c406
5 changed files with 84 additions and 20 deletions

View File

@@ -19,17 +19,11 @@ class DashboardApiController
{
}
public function indexApi()
{
return $this->getDashboardConfiguration();
}
// I dont understand why this method is needed, but if I do a cache clear without this method present, he gives an error saying it needs to be present.
public function setCrudConfig()
{
return null;
}
/**
* Get user dashboard config (not yet based on user id and still hardcoded for now)
*
* @Route("/api/1.0/main/dashboard-config-item.json", methods={"get"})
*/
public function getDashboardConfiguration(): JsonResponse
{
$data = [
@@ -44,7 +38,7 @@ class DashboardApiController
]
];
return new JsonResponse($data);
return new JsonResponse($data, JsonResponse::HTTP_OK, []);
}
}