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 = [ $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);