can delete Consent plan file / added empty page in Consentform.pdf

This commit is contained in:
Frank Schubert
2025-02-14 18:02:16 +01:00
parent 7575ef05fb
commit ee5b11773e
4 changed files with 36 additions and 20 deletions
@@ -489,6 +489,9 @@ class ConstructionConsentController extends mfBaseController {
case "saveCheckbox":
$return = $this->saveCheckboxApi();
break;
case "deleteRimoPlan":
$return = $this->deleteRimoPlanApi();
break;
default:
$this->log->warn(__METHOD__ . ": Called API function '$do' does not exist");
$return = false;
@@ -889,9 +892,17 @@ class ConstructionConsentController extends mfBaseController {
}
private function saveRimoPlanPreviewApi() {
$adb_hausnummer_id = $this->request->building_id;
$consent_id = $this->request->constructionconsent_id;
private function deleteRimoPlanApi() {
$consent_id = $this->request->id;
$consent = new ConstructionConsent($consent_id);
if(!$consent->id) return false;
if($consent->file && $consent->file->file_id) {
$consent->file->delete();
}
return ["message" => "Plan deleted successfully"];
}
private function saveCheckboxApi() {