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 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