forked from mirror/Part-DB.Part-DB-server
Pass typeahead ressource search as query param instead of URL part.
This hopefully fixes the 404 bugs, when putting an URL in the typeahead field...
This commit is contained in:
parent
1a84bdc3a3
commit
e6a3c41cee
1 changed files with 4 additions and 2 deletions
|
@ -46,6 +46,7 @@ use App\Services\Attachments\BuiltinAttachmentsFinder;
|
|||
use App\Services\TagFinder;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Serializer\Encoder\JsonEncoder;
|
||||
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
|
||||
|
@ -59,12 +60,13 @@ use Symfony\Component\Serializer\Serializer;
|
|||
class TypeaheadController extends AbstractController
|
||||
{
|
||||
/**
|
||||
* @Route("/builtInResources/search/{query}", name="typeahead_builtInRessources", requirements={"query"= ".+"})
|
||||
* @Route("/builtInResources/search", name="typeahead_builtInRessources")
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function builtInResources(string $query, BuiltinAttachmentsFinder $finder)
|
||||
public function builtInResources(Request $request, BuiltinAttachmentsFinder $finder)
|
||||
{
|
||||
$query = $request->get('query');
|
||||
$array = $finder->find($query);
|
||||
|
||||
$normalizers = [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue