Skip to content
Snippets Groups Projects
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
Branches PTPS_Controller_2
No related tags found
1 merge request!2Ptps controller 2
......@@ -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);
}
}
<?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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment