1
0

feat(notifications): add option to mark all as read

This commit is contained in:
kolaente
2023-10-20 16:51:35 +02:00
parent d73c62a424
commit ff2b4b8bf4
3 changed files with 29 additions and 1 deletions

View File

@ -15,8 +15,16 @@ export default class NotificationService extends AbstractService<INotification>
}
beforeUpdate(model) {
if (!model) {
return model
}
model.created = new Date(model.created).toISOString()
model.readAt = new Date(model.readAt).toISOString()
return model
}
async markAllRead() {
return this.post('/notifications', false)
}
}