Commit 5b1337b1 authored by Адлан Шамавов's avatar Адлан Шамавов
Browse files

Merge branch 'main' into 'PTPS_Controller_2'

# Conflicts:
#   src/Action/Functions.php
#   src/Controller/HomeController.php
parents 004f3f01 299d09ba
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -30,4 +30,11 @@ class HomeController extends AbstractController
        $result = $this->functions->search($requestData['items'], $id);
        return $this->json($result);
    }

    #[Route('/uniqElements', name: 'uniqElements', methods: ['POST'])]
    public function uniqElements(UniqElementsRequest $request): Response
    {
        $result = $this->functions->uniqElements($request->getRequest()->toArray()['items']);
        return $this->json($result);
    }
}
+16 −0
Original line number Diff line number Diff line
<?php

namespace App\Requests;

use Symfony\Component\Validator\Constraints as Assert;

class UniqElementsRequest extends BaseRequest
{
    #[Assert\All([
        new Assert\Type('array'),
        new Assert\All([
            new Assert\Type('string'),
        ])
    ])]
    public array $items;
}
 No newline at end of file