Merge branch 'dev/presu_cliente_v2' of https://git.imnavajas.es/jjimenez/safekat into dev/presu_cliente_v2
This commit is contained in:
2024-10-19 13:04:05 +02:00
4 changed files with 33 additions and 6 deletions

View File

@ -35,7 +35,8 @@ class ConfigErrores extends BaseResourceController
public function viewForm(int $error_presupuesto_id)
{
$this->errorPresupuestoModel->update($error_presupuesto_id, [
"last_user_id" => auth()->user()->id
"last_user_id" => auth()->user()->id,
"visto" => true,
]);
return view(static::$viewPath . 'viewErrorPresupuestoForm', ["error_presupuesto_id" => $error_presupuesto_id]);
}
@ -47,9 +48,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)
{