[EXCEPTION][UI][UX] Add RedirectException, which can be thrown anywhere to redirect somewhere, and an exception handler

This commit is contained in:
Hugo Sales
2020-09-06 21:38:37 +00:00
committed by Hugo Sales
parent 420b4767b2
commit b906dde059
5 changed files with 74 additions and 21 deletions

View File

@@ -110,27 +110,25 @@ END;
public function replies(Request $request)
{
$actor_id = Common::ensureLoggedIn()->getActor()->getId();
$actor_id = Common::ensureLoggedIn()->getId();
return [
'_template' => 'network/public.html.twig',
'notes' => DB::dql('select n from App\Entity\Note n ' .
'where n.reply_to is not null and n.gsactor_id = ' . $actor_id .
'order by n.created DESC'
),
'where n.reply_to is not null and n.gsactor_id = :id ' .
'order by n.created DESC', ['id' => $gsactor_id]),
];
}
public function favourites(Request $request)
{
$actor_id = Common::ensureLoggedIn()->getActor()->getId();
$actor_id = Common::ensureLoggedIn()->getId();
return [
'_template' => 'network/public.html.twig',
'notes' => DB::dql('select f from App\Entity\Favourite f ' .
'where f.gsactor_id = ' . $actor_id .
'order by f.created DESC'
),
'where f.gsactor_id = :id ' .
'order by f.created DESC', ['id' => $gsactor_id]),
];
}
}