Merge pull request #16788 from grokability/better_handle_arrays_for_model_ids
Better handle model_id arrays passed to the API
This commit is contained in:
commit
143e9cdd61
1 changed files with 8 additions and 2 deletions
|
@ -300,7 +300,13 @@ class AssetsController extends Controller
|
|||
}
|
||||
|
||||
if ($request->filled('model_id')) {
|
||||
$assets->InModelList([$request->input('model_id')]);
|
||||
// If model_id is already an array, just use it as-is
|
||||
if (is_array($request->input('model_id'))) {
|
||||
$assets->InModelList($request->input('model_id'));
|
||||
} else {
|
||||
// Otherwise, turn it into an array
|
||||
$assets->InModelList([$request->input('model_id')]);
|
||||
}
|
||||
}
|
||||
|
||||
if ($request->filled('category_id')) {
|
||||
|
|
Loading…
Add table
Reference in a new issue