diff --git a/App/Controllers/Api.php b/App/Controllers/Api.php index a0ab162..c563c67 100644 --- a/App/Controllers/Api.php +++ b/App/Controllers/Api.php @@ -8,10 +8,10 @@ class Api { $index = []; $index['data'] = [ - "get_url" => "http://lepisi.dev/api/{tablename}{/id}", - "put_url" => "http://lepisi.dev/api/{table}", - "post_url" => "http://lepisi.dev/api/{table}", - "delete_url" => "http://lepisi.dev/api/{table}" + "get_url" => "/api/{tablename}{/id}", + "put_url" => "/api/{table}", + "post_url" => "/api/{table}", + "delete_url" => "/api/{table}" ]; $index['count'] = count($index['data']); @@ -42,7 +42,6 @@ class Api $get['data'] = $model::showAll($table); } } - $get['count'] = count($get['data']); if ($table == 'kategori') { if (isset($get['data'][0])) { @@ -59,6 +58,8 @@ class Api ])); } } + + $get['count'] = count($get['data']); header('Content-Type: application/json'); echo json_encode($get); diff --git a/App/Controllers/Posts.php b/App/Controllers/Posts.php index a71b6c5..e88f3c9 100644 --- a/App/Controllers/Posts.php +++ b/App/Controllers/Posts.php @@ -287,6 +287,11 @@ class Posts unset($args['_addon']); } + if (isset($args['categoryName'])) { unset($args['categoryName']); } + if (isset($args['creatorName'])) { unset($args['creatorName']); } + if (isset($args['background'])) { unset($args['background']); } + if (isset($args['foreground'])) { unset($args['foreground']); } + foreach ($args as $value) { if ($value == '') { $post['status'] = false;