Skip to content
Snippets Groups Projects
PrepareMenuController.php 654 B
Newer Older
Akex's avatar
Akex committed
<?php

namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
Akex's avatar
Akex committed
use function App\Repository\prepareMenu;
Akex's avatar
Akex committed

class PrepareMenuController extends AbstractController
{
    #[Route('/prepare/menu', name: 'app_prepare_menu')]
    public function index(Request $request): Response
    {
        $array = $request->toArray();

        $return = prepareMenu($array);

        return new JsonResponse($return, Response::HTTP_OK);
    }
}