|
|
@@ -29,7 +29,7 @@ class OrderCreateController
|
|
|
->key('user_name', v::stringType()->notEmpty()->alnum('_'))
|
|
|
->key('company_id', v::intType()->positive())
|
|
|
->key('order_name', v::stringType()->notEmpty()->alnum(' '))
|
|
|
- ->key('order_phone', v::stringType()->notEmpty()->length(8, 20))
|
|
|
+ ->key('order_phone', v::optional(v::stringType()->notEmpty()->length(8, 20)), false)
|
|
|
->key('status_status', v::stringType()->notEmpty()->in(['Aberta', 'Finalizada', 'Cancelada']))
|
|
|
->assert($body);
|
|
|
} catch (ValidationException $e) {
|
|
|
@@ -39,7 +39,7 @@ class OrderCreateController
|
|
|
$tableId = (int) $body['table_id'];
|
|
|
$companyId = (int) $body['company_id'];
|
|
|
$orderName = $body['order_name'];
|
|
|
- $orderPhone = $body['order_phone'];
|
|
|
+ $orderPhone = $body['order_phone'] ?? '';
|
|
|
$statusStatus = $body['status_status'];
|
|
|
$userName = $body['user_name'];
|
|
|
|