Fixed saving ConstructionConsentOwner in History

This commit is contained in:
Frank Schubert
2025-10-10 14:37:51 +02:00
parent ae0c4c16b8
commit 6cd61a2750
2 changed files with 8 additions and 6 deletions
@@ -122,11 +122,13 @@ class ConstructionConsentOwnerController extends mfBaseController
if(!$item->save()) {
$this->layout()->setFlash("Beim Speichern ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut.", "error");
} else {
$journal = ConstructionConsentJournal::create([
"constructionconsent_id" => $cc->id,
"text" => "Eigentümer " . ($item->company ? $item->company : $item->firstname . " " . $item->lastname) . " wurde hinzugefügt"
]);
$journal->save();
if($mode == "add") {
$journal = ConstructionConsentJournal::create([
"constructionconsent_id" => $cc->id,
"text" => "Eigentümer " . ($item->company ? $item->company : $item->firstname . " " . $item->lastname) . " wurde hinzugefügt"
]);
$journal->save();
}
$this->layout()->setFlash("Besitzer wurde erfolgreich gespeichert.", "success");
}