From ab82e1cbc0a5e9c0f1890d197935380693e84f45 Mon Sep 17 00:00:00 2001 From: Xu Date: Fri, 18 Dec 2020 17:52:45 +0100 Subject: [PATCH] NewsController: redirect after edit to /news instead of /news/[id] --- src/Controllers/Admin/NewsController.php | 2 +- tests/Unit/Controllers/Admin/NewsControllerTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Controllers/Admin/NewsController.php b/src/Controllers/Admin/NewsController.php index 838c9a94..b7f36940 100644 --- a/src/Controllers/Admin/NewsController.php +++ b/src/Controllers/Admin/NewsController.php @@ -164,6 +164,6 @@ class NewsController extends BaseController $this->addNotification('news.edit.success'); - return $this->redirect->to('/news/' . $news->id); + return $this->redirect->to('/news'); } } diff --git a/tests/Unit/Controllers/Admin/NewsControllerTest.php b/tests/Unit/Controllers/Admin/NewsControllerTest.php index bdf60862..04012b0d 100644 --- a/tests/Unit/Controllers/Admin/NewsControllerTest.php +++ b/tests/Unit/Controllers/Admin/NewsControllerTest.php @@ -204,7 +204,7 @@ class NewsControllerTest extends TestCase ->willReturn($canEditHtml); $this->response->expects($this->once()) ->method('redirectTo') - ->with('http://localhost/news/' . $id) + ->with('http://localhost/news') ->willReturn($this->response); /** @var NewsController $controller */