Loading src/Controller/SortPriceController.php +2 −8 Original line number Diff line number Diff line Loading @@ -3,28 +3,22 @@ namespace App\Controller; use App\Actions\SortPriceAction; use App\Entity\PricesEntity; use App\Requests\PricesRequest; use App\Service\ValidationService; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Attribute\Route; class SortPriceController extends AbstractController { /** * Контроллер волняет сортировку массива по убыванию цены используя sortPrice * @param Request $request * @param PricesRequest $request * @param SortPriceAction $action * @return JsonResponse */ #[Route('/sort/price', name: 'app_sort_price', methods: ['POST'])] public function index(PricesRequest $request, SortPriceAction $action): JsonResponse { return new JsonResponse( $action->act($request->serialise()), 200 ); return new JsonResponse($action->act($request->serialise())); } } Loading
src/Controller/SortPriceController.php +2 −8 Original line number Diff line number Diff line Loading @@ -3,28 +3,22 @@ namespace App\Controller; use App\Actions\SortPriceAction; use App\Entity\PricesEntity; use App\Requests\PricesRequest; use App\Service\ValidationService; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Attribute\Route; class SortPriceController extends AbstractController { /** * Контроллер волняет сортировку массива по убыванию цены используя sortPrice * @param Request $request * @param PricesRequest $request * @param SortPriceAction $action * @return JsonResponse */ #[Route('/sort/price', name: 'app_sort_price', methods: ['POST'])] public function index(PricesRequest $request, SortPriceAction $action): JsonResponse { return new JsonResponse( $action->act($request->serialise()), 200 ); return new JsonResponse($action->act($request->serialise())); } }