Skip to content

Commit

Permalink
Merge pull request #1001 from SlovakNationalGallery/MG-53-sort-items
Browse files Browse the repository at this point in the history
[collection] propagate sorting of items
  • Loading branch information
rastislav-chynoransky authored Apr 25, 2024
2 parents 0367689 + 1931acd commit eb5bafe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/Http/Controllers/Api/CollectionItemController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ public function index(Collection $collection)
$parameters['page'] = request()->integer('page');
}

if (request()->has('sort')) {
$parameters['sort'] = request()->get('sort');
}

$request = Request::create(route('api.v1.items.index', $parameters));
return app()->handle($request);
}
Expand Down

0 comments on commit eb5bafe

Please sign in to comment.