From b229d697a3eecab0316df7ce96b9d45b851399d1 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Wed, 27 Dec 2023 15:48:57 +0100 Subject: [PATCH] Only send notifications on new news by default --- 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 c6fdeb5a..a94263da 100644 --- a/src/Controllers/Admin/NewsController.php +++ b/src/Controllers/Admin/NewsController.php @@ -39,7 +39,7 @@ class NewsController extends BaseController $news = $this->news->find($newsId); $isMeeting = (bool) $request->get('meeting', false); - return $this->showEdit($news, true, $isMeeting); + return $this->showEdit($news, !$news, $isMeeting); } protected function showEdit(?News $news, bool $sendNotification = true, bool $isMeetingDefault = false): Response diff --git a/tests/Unit/Controllers/Admin/NewsControllerTest.php b/tests/Unit/Controllers/Admin/NewsControllerTest.php index 8f466938..ca40cd40 100644 --- a/tests/Unit/Controllers/Admin/NewsControllerTest.php +++ b/tests/Unit/Controllers/Admin/NewsControllerTest.php @@ -44,7 +44,7 @@ class NewsControllerTest extends ControllerTest $this->assertEquals('pages/news/edit.twig', $view); $this->assertNotEmpty($data['news']); - $this->assertTrue($data['send_notification']); + $this->assertFalse($data['send_notification']); return $this->response; });