From 667c1848dc06833c87ed01ea8dc22ce3afd553c4 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 26 Nov 2022 12:48:42 +1100 Subject: [PATCH] Improve validation layer for reports --- app/Http/Requests/Report/GenericReportRequest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Http/Requests/Report/GenericReportRequest.php b/app/Http/Requests/Report/GenericReportRequest.php index a9b34d194..9cfddf60f 100644 --- a/app/Http/Requests/Report/GenericReportRequest.php +++ b/app/Http/Requests/Report/GenericReportRequest.php @@ -55,6 +55,12 @@ class GenericReportRequest extends Request $input['send_email'] = true; } + if (array_key_exists('date_range', $input) && $input['date_range'] != 'custom') { + $input['start_date'] = null; + $input['end_date'] = null; + } + + $this->replace($input); } }