wip: extend model, admin crud
This commit is contained in:
1 parent
974bc95a2d
commit
29dbff90cb
38 files changed
+1240
-830
No files matched your search
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Controller\Admin\AdditionalService;
|
||||
|
||||
use App\Controller\Traits\SortingControllerTrait;
|
||||
use App\Entity\Groups\Accommodation;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
class SortingController extends AbstractController
|
||||
{
|
||||
use SortingControllerTrait;
|
||||
|
||||
public function __construct(private readonly EntityManagerInterface $entityManager)
|
||||
{
|
||||
}
|
||||
|
||||
#[Route('/admin/additional-service/sort/{id}', name: 'app_admin_additionalservice_sort', methods: ['POST'])]
|
||||
public function index(Accommodation $accommodation, Request $request): Response
|
||||
{
|
||||
$this->applySorting($accommodation->getAdditionalServices(), $request->request->all('sorting'));
|
||||
|
||||
$this->entityManager->flush();
|
||||
|
||||
return new Response('', Response::HTTP_NO_CONTENT);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user