Skip to content
Snippets Groups Projects

Ptps|controller 2

Merged Александр Плохих requested to merge PTPS|Controller_2 into main
6 unresolved threads
1 file
+ 1
4
Compare changes
  • Side-by-side
  • Inline
+ 24
0
<?php
namespace App\Controller;
use App\Actions\IdSearchAction;
use App\Requests\UsersRequest;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Routing\Attribute\Route;
class IdSearchController extends AbstractController
{
/**
* Контроллер найдет элемент с указаным id используя sortPrice
* @param UsersRequest $request
* @param IdSearchAction $action
* @return JsonResponse
*/
#[Route('/search', name: 'app_search', methods: ['POST'])]
public function index(UsersRequest $request, IdSearchAction $action): JsonResponse
{
return new JsonResponse($action->act($request->serialise()));
}
}
\ No newline at end of file
Loading