Update CustomFilterController, remove statuses check as we dont support them yet

pull/5928/head
Daniel Supernault 5 months ago
parent 87cf6fd850
commit fc77a98f7b
No known key found for this signature in database
GPG Key ID: 23740873EE6F76A1

@ -22,7 +22,7 @@ class CustomFilterController extends Controller
$filters = CustomFilter::where('profile_id', $request->user()->profile_id)
->unexpired()
->with(['keywords', 'statuses'])
->with(['keywords'])
->orderByDesc('updated_at')
->get()
->map(function ($filter) {
@ -39,12 +39,7 @@ class CustomFilterController extends Controller
'whole_word' => (bool) $keyword->whole_word,
];
}),
'statuses' => $filter->statuses->map(function ($status) {
return [
'id' => $status->id,
'status_id' => $status->status_id,
];
}),
'statuses' => [],
];
});
@ -59,7 +54,7 @@ class CustomFilterController extends Controller
$filter = CustomFilter::findOrFail($id);
Gate::authorize('view', $filter);
$filter->load(['keywords', 'statuses']);
$filter->load(['keywords']);
$res = [
'id' => $filter->id,
@ -74,12 +69,7 @@ class CustomFilterController extends Controller
'whole_word' => (bool) $keyword->whole_word,
];
}),
'statuses' => $filter->statuses->map(function ($status) {
return [
'id' => $status->id,
'status_id' => $status->status_id,
];
}),
'statuses' => [],
];
return response()->json($res);

Loading…
Cancel
Save