From e7772cd825d24a4c0455d526efcddee22ece0b57 Mon Sep 17 00:00:00 2001 From: Perside Rosalie Date: Fri, 2 Aug 2024 09:54:11 +0200 Subject: [PATCH] Fix typo on request input key --- CHANGELOG.md | 5 ++++- app/Http/Controllers/WikiController.php | 2 +- tests/Routes/Wiki/DeleteWikiTest.php | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81c2ab37..f46febb0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # api +## 10x.13.0 - 08 august 2024 +- Fix typo in WikiController and test + ## 10x.12.0 - 8 August 2024 - Normalise WikiLifecycleEvents @@ -13,7 +16,7 @@ - Add Backend for Entity Import Feature T360031 ## 10x.9.1 - 23 July 2024 -- Created downloadable metric for deleted wikis, which can only be accessed by users with admin privileges +- Created downloadable metric for deleted wikis, which can only be accessed by users with admin privileges - Test the csv output of DeletedWikiMetricsController - Add RefreshDatabase or Skip offending tests where these pollute the deleted wiki list diff --git a/app/Http/Controllers/WikiController.php b/app/Http/Controllers/WikiController.php index dfa43327..88906749 100644 --- a/app/Http/Controllers/WikiController.php +++ b/app/Http/Controllers/WikiController.php @@ -167,7 +167,7 @@ public function delete(Request $request): \Illuminate\Http\JsonResponse $wikiId = $request->input('wiki'); $userId = $user->id; - $wikiDeletionReason = $request->input('deletionReason'); + $wikiDeletionReason = $request->input('deletionReasons'); // Check that the requesting user manages the wiki if (WikiManager::where('user_id', $userId)->where('wiki_id', $wikiId)->count() !== 1) { diff --git a/tests/Routes/Wiki/DeleteWikiTest.php b/tests/Routes/Wiki/DeleteWikiTest.php index 34b8ac75..4411ed20 100644 --- a/tests/Routes/Wiki/DeleteWikiTest.php +++ b/tests/Routes/Wiki/DeleteWikiTest.php @@ -24,11 +24,11 @@ public function testDelete() ->actingAs($user, 'api') ->post( 'wiki/delete', - ['wiki' => $wiki->id, 'deletionReason' => 'Some reason for deleting my wiki'] + ['wiki' => $wiki->id, 'deletionReasons' => 'Some reason for deleting my wiki'] ); // check response is correct $response->assertStatus(200); - + $this->assertSame( 'Some reason for deleting my wiki', Wiki::withTrashed()->find($wiki->id)->wiki_deletion_reason