Merge branch 'master' of github.com:mevdschee/php-crud-api
This commit is contained in:
commit
0a1c6ea6d6
2 changed files with 6 additions and 1 deletions
5
api.php
5
api.php
|
|
@ -2419,6 +2419,9 @@ class PHP_CRUD_API {
|
||||||
echo '"200":{';
|
echo '"200":{';
|
||||||
echo '"description":"An array of '.$table['name'].'",';
|
echo '"description":"An array of '.$table['name'].'",';
|
||||||
echo '"schema":{';
|
echo '"schema":{';
|
||||||
|
echo '"type": "object",';
|
||||||
|
echo '"properties": {';
|
||||||
|
echo '"'.$table['name'].'": {';
|
||||||
echo '"type":"array",';
|
echo '"type":"array",';
|
||||||
echo '"items":{';
|
echo '"items":{';
|
||||||
echo '"type": "object",';
|
echo '"type": "object",';
|
||||||
|
|
@ -2451,6 +2454,8 @@ class PHP_CRUD_API {
|
||||||
}
|
}
|
||||||
echo '}'; //properties
|
echo '}'; //properties
|
||||||
echo '}'; //items
|
echo '}'; //items
|
||||||
|
echo '}'; //table
|
||||||
|
echo '}'; //properties
|
||||||
echo '}'; //schema
|
echo '}'; //schema
|
||||||
echo '}'; //200
|
echo '}'; //200
|
||||||
echo '}'; //responses
|
echo '}'; //responses
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ switch ($method) {
|
||||||
case 'POST':
|
case 'POST':
|
||||||
$sql = "insert into `$table` set $set"; break;
|
$sql = "insert into `$table` set $set"; break;
|
||||||
case 'DELETE':
|
case 'DELETE':
|
||||||
$sql = "delete `$table` where id=$key"; break;
|
$sql = "delete from `$table` where id=$key"; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute SQL statement
|
// execute SQL statement
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue