mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-01-29 19:18:11 +01:00
Fixed groups order on API
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”
This commit is contained in:
parent
37efa3690d
commit
7cdd537b42
@ -62,7 +62,7 @@ class ComponentGroupController extends AbstractApiController
|
||||
$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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user