Final updates for v2.0 #29

Merged
ryan merged 14 commits from 1.3 into main 2026-06-25 14:52:13 -04:00
2 changed files with 5 additions and 5 deletions
Showing only changes of commit 9e56f65af5 - Show all commits
+1 -1
View File
@@ -262,7 +262,7 @@ class AjaxController extends AbstractController
$user = $this->getUser();
$res = new Response();
$data = json_decode($req->getContent());
$note = $emi->getRepository(Note::class)->findNote($data->query, $user->getId()->toBinary());
$note = $emi->getRepository(Note::class)->findNote($data->query, $user);
$res->setContent(json_encode($note));
return $res;
+4 -4
View File
@@ -25,7 +25,7 @@ class NoteRepository extends ServiceEntityRepository
$ret = $this->createQueryBuilder('n')
->where('n.user = :user')
->setParameter('user', $user->getId()->toBinary())
->setParameter('user', $user->getId(), 'uuid')
->orderBy('n.date', 'DESC')
->getQuery()
->getResult();
@@ -40,7 +40,7 @@ class NoteRepository extends ServiceEntityRepository
}
$ret = $this->createQueryBuilder('n')
->where('n.user = :user')
->setParameter('user', $user->getId()->toBinary())
->setParameter('user', $user->getId(), 'uuid')
->orderBy('n.date', 'DESC')
->setMaxResults(4)
->getQuery()
@@ -49,7 +49,7 @@ class NoteRepository extends ServiceEntityRepository
return $ret;
}
public function findNote(string $query, string $userId): array
public function findNote(string $query, User $user): array
{
$ret = $this->createQueryBuilder('n')
->where('n.title LIKE :query')
@@ -57,7 +57,7 @@ class NoteRepository extends ServiceEntityRepository
->orWhere('n.text LIKE :query')
->andWhere('n.user = :user')
->setParameter('query', "%{$query}%")
->setParameter('user', $userId)
->setParameter('user', $user->getId(), 'uuid')
->orderBy('n.date', 'DESC')
->setMaxResults(3)
->getQuery()