Add all and none special tags

This commit is contained in:
Tim
2025-05-10 21:10:00 +02:00
parent b8ae8bb8a7
commit 0648db62e3
5 changed files with 31 additions and 9 deletions

View File

@ -79,7 +79,11 @@ class SnipRepository extends ServiceEntityRepository
throw new \InvalidArgumentException('Invalid sort option: ', $request->sort);
}
if ($request->tag) {
if ($request->tag === 'none') {
$qb->andWhere('s.tags IS EMPTY');
} elseif ($request->tag === 'all') {
// No filter needed
} else {
$qb->innerJoin('s.tags', 't')
->andWhere('t.name = :tag')
->setParameter('tag', $request->tag)