adds insertFile to the new ProfilUpdate FhcAPIController and starts a transaction when deleting the foreign key from the profil update and deleting the old file

This commit is contained in:
SimonGschnell
2024-07-22 11:24:47 +02:00
parent 0cc6222175
commit a0871657ca
5 changed files with 139 additions and 10 deletions
@@ -77,6 +77,21 @@ class Profil_update_model extends DB_Model
}
//? remove File from the Profil Update
public function removeFileFromProfilUpdate($dms_id)
{
if(!is_int($dms_id) || $dms_id < 0){
return error("not valid dms_id");
}
return $this->execReadOnlyQuery("
UPDATE public.tbl_profil_update
SET attachment_id = NULL
WHERE attachment_id = ?", [$dms_id]);
}
/**
* getProfilUpdateWithPermission