fix : contemplat que presupuesto_id es null

This commit is contained in:
amazuecos
2024-10-19 08:54:53 +00:00
parent 035d695780
commit 4d20b4ac1c
4 changed files with 31 additions and 5 deletions

View File

@ -47,9 +47,12 @@ class ConfigErrores extends BaseResourceController
}
public function get_error_presupuesto(int $error_presupuesto_id)
{
$data = $this->errorPresupuestoModel->getQueryDatatable()
->where("presupuesto_errores.id", $error_presupuesto_id)->get()->getResultObject()[0];
return $this->response->setJSON(["data" => $data]);
$data = $this->errorPresupuestoModel->getErrorPresupuestoForm($error_presupuesto_id);
if(isset($data[0])){
return $this->response->setJSON(["data" => $data[0]]);
}else{
return $this->response->setJSON(["data" => []]);
}
}
public function update_error_presupuesto(int $error_presupuesto_id)
{