}
loadNotifications (reset?: boolean) {
- this.userNotificationService.listMyNotifications({
+ const options = {
pagination: this.componentPagination,
ignoreLoadingBar: this.ignoreLoadingBar,
sort: {
// if we order by creation date, we want DESC. all other fields are ASC (like unread).
order: this.sortField === 'createdAt' ? -1 : 1
}
- })
+ }
+
+ this.userNotificationService.listMyNotifications(options)
.subscribe(
result => {
this.notifications = reset ? result.data : this.notifications.concat(result.data)