mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 08:13:16 +00:00
Update AdminController, show open reports by default
This commit is contained in:
parent
52a120c0db
commit
b1fd99644b
1 changed files with 2 additions and 5 deletions
|
@ -66,17 +66,14 @@ class AdminController extends Controller
|
||||||
|
|
||||||
public function reports(Request $request)
|
public function reports(Request $request)
|
||||||
{
|
{
|
||||||
$this->validate($request, [
|
$filter = $request->input('filter') == 'closed' ? 'closed' : 'open';
|
||||||
'filter' => 'nullable|string|in:all,open,closed'
|
|
||||||
]);
|
|
||||||
$filter = $request->input('filter');
|
|
||||||
$reports = Report::orderBy('created_at','desc')
|
$reports = Report::orderBy('created_at','desc')
|
||||||
->when($filter, function($q, $filter) {
|
->when($filter, function($q, $filter) {
|
||||||
return $filter == 'open' ?
|
return $filter == 'open' ?
|
||||||
$q->whereNull('admin_seen') :
|
$q->whereNull('admin_seen') :
|
||||||
$q->whereNotNull('admin_seen');
|
$q->whereNotNull('admin_seen');
|
||||||
})
|
})
|
||||||
->paginate(4);
|
->paginate(6);
|
||||||
return view('admin.reports.home', compact('reports'));
|
return view('admin.reports.home', compact('reports'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue