mirror of
https://git.cant.at/Madeorsk/PollVerlaine
synced 2024-11-22 12:54:31 +01:00
206 Created
This commit is contained in:
parent
a031045f66
commit
57648296b5
@ -20,7 +20,7 @@ Flight::route("POST /polls", function () {
|
|||||||
$request_json = $request->data;
|
$request_json = $request->data;
|
||||||
$poll = Poll::create_poll($request_json);
|
$poll = Poll::create_poll($request_json);
|
||||||
if ($poll)
|
if ($poll)
|
||||||
Flight::json(format_poll($poll), 206);
|
Flight::json(format_poll($poll), 201);
|
||||||
else
|
else
|
||||||
Flight::halt(403, "<h1>403 Forbidden</h1><h3>Invalid data.</h3>");
|
Flight::halt(403, "<h1>403 Forbidden</h1><h3>Invalid data.</h3>");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user