From d2edb96a961cde2c51a5b49031834a912dc8c001 Mon Sep 17 00:00:00 2001 From: Vincent Auger Date: Thu, 28 Nov 2024 09:50:12 -0400 Subject: [PATCH] fix: failing test if `is_open_access` is not set --- app/Http/Controllers/PublicationController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/PublicationController.php b/app/Http/Controllers/PublicationController.php index f48e1b30..81b052f1 100644 --- a/app/Http/Controllers/PublicationController.php +++ b/app/Http/Controllers/PublicationController.php @@ -56,7 +56,7 @@ public function store(Request $request): JsonResource 'is_open_access' => 'boolean', ]); - if ($validated['is_open_access']) { + if (isset($validated['is_open_access']) && $validated['is_open_access']) { $validated['embargoed_until'] = null; } @@ -114,7 +114,7 @@ public function update(Request $request, Publication $publication): JsonResource 'is_open_access' => 'boolean', ]); - if ($validated['is_open_access']) { + if (isset($validated['is_open_access']) && $validated['is_open_access']) { $validated['embargoed_until'] = null; }