Skip to content

Commit 0a1c6ea

Browse files
committed
Merge branch 'master' of github.com:mevdschee/php-crud-api
2 parents a534923 + 74bc8c2 commit 0a1c6ea

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

api.php

+5
Original file line numberDiff line numberDiff line change
@@ -2419,6 +2419,9 @@ protected function swagger($settings) {
24192419
echo '"200":{';
24202420
echo '"description":"An array of '.$table['name'].'",';
24212421
echo '"schema":{';
2422+
echo '"type": "object",';
2423+
echo '"properties": {';
2424+
echo '"'.$table['name'].'": {';
24222425
echo '"type":"array",';
24232426
echo '"items":{';
24242427
echo '"type": "object",';
@@ -2451,6 +2454,8 @@ protected function swagger($settings) {
24512454
}
24522455
echo '}'; //properties
24532456
echo '}'; //items
2457+
echo '}'; //table
2458+
echo '}'; //properties
24542459
echo '}'; //schema
24552460
echo '}'; //200
24562461
echo '}'; //responses

extras/core.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
case 'POST':
3838
$sql = "insert into `$table` set $set"; break;
3939
case 'DELETE':
40-
$sql = "delete `$table` where id=$key"; break;
40+
$sql = "delete from `$table` where id=$key"; break;
4141
}
4242

4343
// execute SQL statement

0 commit comments

Comments
 (0)