Update Cartolas

This commit is contained in:
Juan Pablo Vial
2024-08-27 14:48:21 -04:00
parent 2070987403
commit 552a4c7aca

View File

@ -139,4 +139,18 @@ class Cartolas extends Controller
} }
return $this->withJson($response, $output); return $this->withJson($response, $output);
} }
public function update(ServerRequestInterface $request, ResponseInterface $response,
Service\Contabilidad\Cartola $cartolaService): ResponseInterface
{
$output = [
'cartolas' => []
];
try {
$cuentas = $cartolaService->check();
if (count($cuentas) > 0) {
$output['cartolas'] = $cartolaService->update($cuentas);
}
} catch (EmptyResult) {}
return $this->withJson($response, $output);
}
} }