}
this.userNotificationService.listMyNotifications(options)
- .subscribe(
- result => {
+ .subscribe({
+ next: result => {
this.notifications = reset ? result.data : this.notifications.concat(result.data)
this.componentPagination.totalItems = result.total
this.onDataSubject.next(result.data)
},
- err => this.notifier.error(err.message)
- )
+ error: err => this.notifier.error(err.message)
+ })
}
onNearOfBottom () {
if (notification.read) return
this.userNotificationService.markAsRead(notification)
- .subscribe(
- () => {
+ .subscribe({
+ next: () => {
notification.read = true
},
- err => this.notifier.error(err.message)
- )
+ error: err => this.notifier.error(err.message)
+ })
}
markAllAsRead () {
this.userNotificationService.markAllAsRead()
- .subscribe(
- () => {
+ .subscribe({
+ next: () => {
for (const notification of this.notifications) {
notification.read = true
}
},
- err => this.notifier.error(err.message)
- )
+ error: err => this.notifier.error(err.message)
+ })
}
changeSortColumn (column: string) {