Usar success

This commit is contained in:
Juan Pablo Vial
2025-01-17 00:04:34 -03:00
parent 16100f622e
commit bf054c22c2

View File

@ -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);