Eliminar desistimiento y loading en editar desistimiento

This commit is contained in:
2023-12-22 12:52:04 -03:00
parent afbadd520b
commit 8492d1df2b
5 changed files with 96 additions and 18 deletions

View File

@ -258,4 +258,16 @@ class Ventas
} catch (EmptyResult) {}
return $this->withJson($response, $output);
}
public function insistir(ServerRequestInterface $request, ResponseInterface $response, Service\Venta $ventaService, int $venta_id): ResponseInterface
{
$output = [
'venta_id' => $venta_id,
'eliminado' => false
];
try {
$venta = $ventaService->getById($venta_id);
$output['eliminado'] = $ventaService->insistir($venta);
} catch (EmptyResult) {}
return $this->withJson($response, $output);
}
}