diff options
author | V.Krishn <vkrishn4@gmail.com> | 2016-06-21 18:13:35 +0530 |
---|---|---|
committer | V.Krishn <vkrishn4@gmail.com> | 2016-06-21 18:13:35 +0530 |
commit | d54542e03c9d5ed6b96c750cb4aa9800ea45ef11 (patch) | |
tree | 4a417efa70a1f3673f6e14362cd0980acb05e18d | |
parent | 4b837c9bf9558fc29c5798027a95e26e49b9f892 (diff) | |
download | aport-api-d54542e03c9d5ed6b96c750cb4aa9800ea45ef11.tar.bz2 |
minor bug fix, set default order
-rw-r--r-- | index.php | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -347,7 +347,6 @@ $app->get('/categories', function() use ($app) { // Retrieves packages $app->get('/packages', function() use ($app) { - $data = initJapiData($app, 'packages'); $data = get_package(array(), $data, $app); @@ -358,7 +357,7 @@ $app->get('/packages', function() use ($app) { function get_package($filter=array(), $data=array(), $app) { $condt = implode(' AND ', @$filter['filter2']); - $sort = $filter['filter']['sort']; + $sort = isset($filter['filter']['sort']) ? $filter['filter']['sort'] : "id DESC"; # get Packages count $params = array( 'conditions' => "$condt" ); |