Usar success
This commit is contained in:
@ -18,11 +18,11 @@ class Facturas extends Controller
|
|||||||
$output = [
|
$output = [
|
||||||
'input' => $data,
|
'input' => $data,
|
||||||
'factura' => null,
|
'factura' => null,
|
||||||
'saved' => false
|
'success' => false
|
||||||
];
|
];
|
||||||
try {
|
try {
|
||||||
$output['factura'] = $facturaService->add($data);
|
$output['factura'] = $facturaService->add($data);
|
||||||
$output['saved'] = true;
|
$output['success'] = true;
|
||||||
} catch (Implement\Exception\EmptyResult) {
|
} catch (Implement\Exception\EmptyResult) {
|
||||||
$output['error'] = 'No se pudo agregar la factura';
|
$output['error'] = 'No se pudo agregar la factura';
|
||||||
return $this->withJson($response, $output, 400);
|
return $this->withJson($response, $output, 400);
|
||||||
|
Reference in New Issue
Block a user