Skip to content

Commit

Permalink
Fixed groups order on API
Browse files Browse the repository at this point in the history
Issue: if the request use “?sort=order” returns groups ordered by “order DESC”.

This is unexpected.
If I would a reversed order I have to use “sort=order&order=desc”
  • Loading branch information
billmn committed Oct 5, 2016
1 parent 37efa36 commit 7cdd537
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/ComponentGroupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function getGroups()
$groups->search(Binput::except(['sort', 'order', 'per_page']));

if ($sortBy = Binput::get('sort')) {
$direction = Binput::has('order') && Binput::get('order') == 'desc';
$direction = Binput::get('order', 'asc');

$groups->sort($sortBy, $direction);
}
Expand Down

0 comments on commit 7cdd537

Please sign in to comment.