From 940f1c2eccb1966c1db24d05e41814f056e84fe5 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 14 Nov 2024 12:24:15 +0000 Subject: [PATCH] Fixed #15812 - regression in action_type search Signed-off-by: snipe --- app/Http/Controllers/Api/ReportsController.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/Http/Controllers/Api/ReportsController.php b/app/Http/Controllers/Api/ReportsController.php index 63fca39d19..1a86e51684 100644 --- a/app/Http/Controllers/Api/ReportsController.php +++ b/app/Http/Controllers/Api/ReportsController.php @@ -44,6 +44,22 @@ class ReportsController extends Controller }); } + if ($request->filled('action_type')) { + $actionlogs = $actionlogs->where('action_type', '=', $request->input('action_type'))->orderBy('created_at', 'desc'); + } + + if ($request->filled('created_by')) { + $actionlogs = $actionlogs->where('created_by', '=', $request->input('created_by')); + } + + if ($request->filled('action_source')) { + $actionlogs = $actionlogs->where('action_source', '=', $request->input('action_source'))->orderBy('created_at', 'desc'); + } + + if ($request->filled('remote_ip')) { + $actionlogs = $actionlogs->where('remote_ip', '=', $request->input('remote_ip'))->orderBy('created_at', 'desc'); + } + if ($request->filled('uploads')) { $actionlogs = $actionlogs->whereNotNull('filename')->orderBy('created_at', 'desc');