Skip to content

Commit

Permalink
fix settings single collection response
Browse files Browse the repository at this point in the history
  • Loading branch information
wellingguzman committed Sep 21, 2016
1 parent b153948 commit eb9e6c3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions api/api.php
Expand Up @@ -1207,9 +1207,11 @@
break;
}

$settings_new = $Settings->fetchAll();
// $get_new = is_null($id) ? $settings_new : $settings_new[$id];
$response = array_key_exists($id, $settings_new) ? $settings_new : null;
$response = $Settings->fetchAll();
if (!is_null($id)) {
$response = array_key_exists($id, $response) ? $response[$id] : null;
}

if (!$response) {
$response = [
'message' => __t('unable_to_find_setting_collection_x', ['collection' => $id]),
Expand Down

0 comments on commit eb9e6c3

Please sign in to comment.