|
@@ -33,7 +33,7 @@ class OrderCreateController
|
|
|
->key('status_status', v::stringType()->notEmpty()->in(['Aberta', 'Finalizada', 'Cancelada']))
|
|
->key('status_status', v::stringType()->notEmpty()->in(['Aberta', 'Finalizada', 'Cancelada']))
|
|
|
->assert($body);
|
|
->assert($body);
|
|
|
} catch (ValidationException $e) {
|
|
} catch (ValidationException $e) {
|
|
|
- return ResponseLib::sendFail("Validation failed: " . $e->getFullMessage(), [], "E_VALIDATE")->withStatus(422);
|
|
|
|
|
|
|
+ return ResponseLib::sendFail("Validation failed: " . $e->getFullMessage(), [], "E_VALIDATE")->withStatus(401);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$tableId = (int) $body['table_id'];
|
|
$tableId = (int) $body['table_id'];
|
|
@@ -47,7 +47,7 @@ class OrderCreateController
|
|
|
$userId = $this->getUserIdByUserName($userName, $companyId);
|
|
$userId = $this->getUserIdByUserName($userName, $companyId);
|
|
|
|
|
|
|
|
if (!$userId) {
|
|
if (!$userId) {
|
|
|
- return ResponseLib::sendFail("User '{$userName}' Not Found", [], "E_USER_NOT_FOUND")->withStatus(404);
|
|
|
|
|
|
|
+ return ResponseLib::sendFail("User '{$userName}' Not Found", [], "E_USER_NOT_FOUND")->withStatus(204);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$statusId = $this->model->getStatusIdByName($statusStatus);
|
|
$statusId = $this->model->getStatusIdByName($statusStatus);
|