Improved usability of part select element

This commit is contained in:
Jan Böhmer 2022-12-24 16:25:29 +01:00
parent 7558d57545
commit 64e7ce4ad6
3 changed files with 8 additions and 6 deletions

View file

@ -136,14 +136,14 @@ class TypeaheadController extends AbstractController
* @param EntityManagerInterface $entityManager
* @return JsonResponse
*/
public function parts(string $query, EntityManagerInterface $entityManager, PartPreviewGenerator $previewGenerator,
AttachmentURLGenerator $attachmentURLGenerator): JsonResponse
public function parts(EntityManagerInterface $entityManager, PartPreviewGenerator $previewGenerator,
AttachmentURLGenerator $attachmentURLGenerator, string $query = ""): JsonResponse
{
$this->denyAccessUnlessGranted('@parts.read');
$repo = $entityManager->getRepository(Part::class);
$parts = $repo->autocompleteSearch($query);
$parts = $repo->autocompleteSearch($query, 100);
$data = [];
foreach ($parts as $part) {