From cd6962e9e430b3f3e35b8a5d4c941e4d94c4c52e Mon Sep 17 00:00:00 2001 From: jpsider Date: Sun, 17 Sep 2017 10:58:03 -0400 Subject: [PATCH 1/2] Updated the Delete command in the core.php file --- extras/core.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/core.php b/extras/core.php index 91e4799..70a71c0 100644 --- a/extras/core.php +++ b/extras/core.php @@ -37,7 +37,7 @@ switch ($method) { case 'POST': $sql = "insert into `$table` set $set"; break; case 'DELETE': - $sql = "delete `$table` where id=$key"; break; + $sql = "delete from `$table` where id=$key"; break; } // execute SQL statement From bbbfbb40f4eabc3eadad037daa4e8fc45111e37f Mon Sep 17 00:00:00 2001 From: xhorntail Date: Tue, 10 Oct 2017 03:17:07 -0600 Subject: [PATCH 2/2] Update api.php --- api.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api.php b/api.php index 1f6e0ae..d5a828d 100644 --- a/api.php +++ b/api.php @@ -2419,6 +2419,9 @@ class PHP_CRUD_API { echo '"200":{'; echo '"description":"An array of '.$table['name'].'",'; echo '"schema":{'; + echo '"type": "object",'; + echo '"properties": {'; + echo '"'.$table['name'].'": {'; echo '"type":"array",'; echo '"items":{'; echo '"type": "object",'; @@ -2451,6 +2454,8 @@ class PHP_CRUD_API { } echo '}'; //properties echo '}'; //items + echo '}'; //table + echo '}'; //properties echo '}'; //schema echo '}'; //200 echo '}'; //responses