From ac986006405593ad1788280a173096b22e9b55cc Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Sat, 11 Jul 2015 11:26:48 +0200 Subject: [PATCH] More RESTish URL (/notice/:notice/delete) for notice delete Also returns to 'top' now after notice deletion. --- actions/deletenotice.php | 10 ++-------- lib/router.php | 4 +--- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/actions/deletenotice.php b/actions/deletenotice.php index d8037ab444..40b276a348 100644 --- a/actions/deletenotice.php +++ b/actions/deletenotice.php @@ -68,16 +68,10 @@ class DeletenoticeAction extends FormAction $this->notice->delete(); Event::handle('EndDeleteOwnNotice', array($this->scoped->getUser(), $this->notice)); } - } - - $url = common_get_returnto(); - - if ($url) { - common_set_returnto(null); } else { - $url = common_local_url('public'); + common_redirect(common_get_returnto(), 303); } - common_redirect($url, 303); + common_redirect(common_local_url('top'), 303); } } diff --git a/lib/router.php b/lib/router.php index 249e5e8823..b13c51c328 100644 --- a/lib/router.php +++ b/lib/router.php @@ -244,12 +244,10 @@ class Router array('action' => 'shownotice'), array('notice' => '[0-9]+')); - $m->connect('notice/delete/:notice', + $m->connect('notice/:notice/delete', array('action' => 'deletenotice'), array('notice' => '[0-9]+')); - $m->connect('notice/delete', array('action' => 'deletenotice')); - // conversation $m->connect('conversation/:id', -- 2.39.5