Skip to content

Commit

Permalink
Merge pull request #14498 from snipe/features/limit_report_by_admin
Browse files Browse the repository at this point in the history
Fixed #14495 - Allow user_id to be passed to limit to only specific admins
  • Loading branch information
snipe authored Mar 26, 2024
2 parents f450caf + 3ced850 commit df49e83
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/Http/Controllers/Api/ReportsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ public function index(Request $request)
$actionlogs = $actionlogs->where('action_type', '=', $request->input('action_type'))->orderBy('created_at', 'desc');
}

if ($request->filled('user_id')) {
$actionlogs = $actionlogs->where('user_id', '=', $request->input('user_id'));
}

if ($request->filled('action_source')) {
$actionlogs = $actionlogs->where('action_source', '=', $request->input('action_source'))->orderBy('created_at', 'desc');
}
Expand Down

0 comments on commit df49e83

Please sign in to comment.