Update search
This commit is contained in:
@ -239,12 +239,14 @@ class AjaxController extends AbstractController
|
||||
return $res;
|
||||
}
|
||||
|
||||
#[Route('/search-note', name: 'app_open_note')]
|
||||
public function openNote(Request $req, EntityManagerInterface $emi): Response
|
||||
#[Route('/search', name: 'app_search_note')]
|
||||
public function searchNote(Request $req, EntityManagerInterface $emi): Response
|
||||
{
|
||||
/** @var User $user */
|
||||
$user = $this->getUser();
|
||||
$res = new Response();
|
||||
$data = json_decode($req->getContent());
|
||||
$note = $emi->getRepository(Note::class)->findNote($data->search);
|
||||
$note = $emi->getRepository(Note::class)->findNote($data->query, $user->getId()->toBinary());
|
||||
$res->setContent(json_encode($note));
|
||||
|
||||
return $res;
|
||||
|
Reference in New Issue
Block a user