diff --git a/admin/src/app/features/calendar/components/calendar-view/calendar-view.ts b/admin/src/app/features/calendar/components/calendar-view/calendar-view.ts
index 1d2404b..7b7690b 100644
--- a/admin/src/app/features/calendar/components/calendar-view/calendar-view.ts
+++ b/admin/src/app/features/calendar/components/calendar-view/calendar-view.ts
@@ -206,6 +206,9 @@ export class CalendarView {
console.log('Parent received:', msg);
if (msg == 'close') {
this.closeDialog();
+ } else if ( msg == 'save-event-success'){
+ this.closeDialog();
+ this.calendarComponent?.getApi().refetchEvents();
}
};
diff --git a/admin/src/app/features/calendar/components/calendar-view/single-event-dashboard-event-edit/single-event-dashboard-event-edit.html b/admin/src/app/features/calendar/components/calendar-view/single-event-dashboard-event-edit/single-event-dashboard-event-edit.html
index 5d6f6e2..e756b34 100644
--- a/admin/src/app/features/calendar/components/calendar-view/single-event-dashboard-event-edit/single-event-dashboard-event-edit.html
+++ b/admin/src/app/features/calendar/components/calendar-view/single-event-dashboard-event-edit/single-event-dashboard-event-edit.html
@@ -1,3 +1,3 @@
-
diff --git a/admin/src/app/features/calendar/components/calendar-view/single-event-dashboard-event-edit/single-event-dashboard-event-edit.ts b/admin/src/app/features/calendar/components/calendar-view/single-event-dashboard-event-edit/single-event-dashboard-event-edit.ts
index 7340727..6210ec7 100644
--- a/admin/src/app/features/calendar/components/calendar-view/single-event-dashboard-event-edit/single-event-dashboard-event-edit.ts
+++ b/admin/src/app/features/calendar/components/calendar-view/single-event-dashboard-event-edit/single-event-dashboard-event-edit.ts
@@ -21,8 +21,10 @@ export class SingleEventDashboardEventEdit {
protected readonly SvgIcons = SvgIcons;
- protected triggerAction() {
-
- this.onAction()('close')
+ /**
+ * proxy to ready event from form to parent
+ */
+ protected triggerAction(action: string) {
+ this.onAction()(action)
}
}
diff --git a/admin/src/app/features/calendar/components/calendar-view/single-event-dashboard/single-event-dashboard.html b/admin/src/app/features/calendar/components/calendar-view/single-event-dashboard/single-event-dashboard.html
index a592e63..3fca90d 100644
--- a/admin/src/app/features/calendar/components/calendar-view/single-event-dashboard/single-event-dashboard.html
+++ b/admin/src/app/features/calendar/components/calendar-view/single-event-dashboard/single-event-dashboard.html
@@ -18,7 +18,6 @@
(onAction)="onCardAction(card.action)"
>
-
}
diff --git a/admin/src/app/features/calendar/components/create-event-form/create-event-form.html b/admin/src/app/features/calendar/components/create-event-form/create-event-form.html
index 929005e..32bc59f 100644
--- a/admin/src/app/features/calendar/components/create-event-form/create-event-form.html
+++ b/admin/src/app/features/calendar/components/create-event-form/create-event-form.html
@@ -106,7 +106,7 @@
}
-
Mégse
+
Mégse
diff --git a/admin/src/app/features/calendar/components/create-event-form/create-event-form.ts b/admin/src/app/features/calendar/components/create-event-form/create-event-form.ts
index ad97b48..e6d45be 100644
--- a/admin/src/app/features/calendar/components/create-event-form/create-event-form.ts
+++ b/admin/src/app/features/calendar/components/create-event-form/create-event-form.ts
@@ -28,7 +28,7 @@ export type FrequencyOption = {
export class CreateEventForm implements OnInit {
form: FormGroup;
isEditMode = false;
- ready = output
();
+ ready = output();
id = input();
date = input();
eventTypes = signal([]);
@@ -248,8 +248,13 @@ export class CreateEventForm implements OnInit {
}
action$.subscribe({
- next: () => this.router.navigate(['/calendar']),
- error: (err) => console.error('Failed to save event', err),
+ next: () => {
+ this.ready.emit('save-event-success');
+ },
+ error: (err) =>{
+ console.error('Failed to save event', err);
+ this.ready.emit('save-event-failed');
+ }
});
}
@@ -306,6 +311,6 @@ export class CreateEventForm implements OnInit {
}
doReady() {
- this.ready.emit();
+ this.ready.emit('close');
}
}