Add extra meta data to snip view and show all snips in public

This commit is contained in:
Tim
2025-04-23 23:21:06 +02:00
parent af9f83f189
commit bf55e069e0
6 changed files with 9 additions and 7 deletions

View File

@ -36,7 +36,7 @@ class SnipController extends AbstractController
public function public(): Response
{
return $this->render('snip/index.html.twig', [
'snips' => $this->repository->findPublic($this->getUser()),
'snips' => $this->repository->findPublic(),
'title' => 'Public Snips',
]);
}

View File

@ -51,7 +51,7 @@ class SnipRepository extends ServiceEntityRepository
return $qb->getQuery()->getResult();
}
public function findPublic(?User $user): array
public function findPublic(?User $user = null): array
{
$qb = $this->createQueryBuilder('s')
->where('s.public = :public')