Make sure sort key exists

This commit is contained in:
Toby Zerner 2015-07-28 12:27:59 +09:30
parent f07ab4633b
commit 62a01c69a9

View File

@ -29,7 +29,7 @@ class IndexAction extends ClientAction
$q = array_pull($queryParams, 'q'); $q = array_pull($queryParams, 'q');
$params = [ $params = [
'sort' => $sort ? $this->sortMap[$sort] : '', 'sort' => $sort && isset($this->sortMap[$sort]) ? $this->sortMap[$sort] : '',
'filter' => ['q' => $q] 'filter' => ['q' => $q]
]; ];