Allow POST for day
parent
b62e73735c
commit
efd9232c94
|
@ -18,6 +18,7 @@ return [
|
|||
// API
|
||||
['name' => 'api#days', 'url' => '/api/days', 'verb' => 'GET'],
|
||||
['name' => 'api#day', 'url' => '/api/days/{id}', 'verb' => 'GET'],
|
||||
['name' => 'api#day', 'url' => '/api/days/{id}', 'verb' => 'POST'],
|
||||
['name' => 'api#imageInfo', 'url' => '/api/info/{id}', 'verb' => 'GET'],
|
||||
['name' => 'api#imageEdit', 'url' => '/api/edit/{id}', 'verb' => 'PATCH'],
|
||||
['name' => 'api#archive', 'url' => '/api/archive/{id}', 'verb' => 'PATCH'],
|
||||
|
|
|
@ -183,6 +183,14 @@ class ApiController extends Controller {
|
|||
}
|
||||
$uid = $user->getUID();
|
||||
|
||||
// Check if post request
|
||||
if ($this->request->getMethod() === 'POST') {
|
||||
$id = $this->request->getParam('body_ids');
|
||||
if (is_null($id)) {
|
||||
return new JSONResponse([], Http::STATUS_BAD_REQUEST);
|
||||
}
|
||||
}
|
||||
|
||||
// Split at commas and convert all parts to int
|
||||
$day_ids = array_map(function ($part) {
|
||||
return intval($part);
|
||||
|
|
Loading…
Reference in New Issue