Fix unit persistence before saving timetable lessons
CI / build-and-test (push) Canceled after 0s

This commit is contained in:
admin committed 2026-11-09 21:50:36 +01:00
1 parent cbcb739097
commit fb38b6bb04
5 files changed
+53 -1

No files matched your search

@@ -789,6 +789,10 @@ public partial class LessonDialogViewModel : ObservableObject
// Für die KI-Unterstützung mit Fokus auf genau diese Stunde (4.5.22) — nur für bereits
// gespeicherte Stunden sinnvoll, eine gerade erst angelegte, noch ungespeicherte Stunde hat
// keine echte Id, auf die sich die KI beziehen könnte.
// Persist a pending parent only after validation and before writing its first lesson.
public Action? BeforeSave { get; set; }
public void EnsureParentSaved() => BeforeSave?.Invoke();
public Guid UnitId => _unitId;
public Guid GroupId => _groupId;
public Lesson? EditingLesson => _editingLesson;
@@ -1079,6 +1083,7 @@ public partial class LessonDialogViewModel : ObservableObject
if (!valid) return;
EnsureParentSaved();
Result = _editingLesson ?? new Lesson { UnitId = _unitId, GroupId = _groupId };
Result.UnitId = _unitId;
Result.GroupId = _groupId;