Skip to content

Commit 205c402

Browse files
committed
Fix activate_at date not being sent correctly for notifications
1 parent 218ce79 commit 205c402

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/app/admin/components/notifications/notifications.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export class NotificationsComponent implements OnInit {
6565
width: '400px', data: {notification},
6666
});
6767
dialogRef.componentInstance.onUpdate$.subscribe(() => {
68+
notification.activatedAt = notification.activatedAt != null ? moment(new Date()).format('YYYY-MM-DD hh:mm:ss') : null;
6869
this.update(notification.id, {level: notification.level, message: notification.message, activatedAt: notification.activatedAt})
6970
.then(() => this.onDataChange(notification));
7071
});
@@ -80,6 +81,8 @@ export class NotificationsComponent implements OnInit {
8081
}
8182

8283
if (notification.id) {
84+
notification.activatedAt = notification.activatedAt != null ? moment(new Date()).format('YYYY-MM-DD hh:mm:ss') : null;
85+
8386
this.update(notification.id, {level: notification.level, message: notification.message, activatedAt: notification.activatedAt}).then((data) => {
8487
notification.message = data.message;
8588
notification.originalText = data.message;

0 commit comments

Comments
 (0)