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