feat(notifications): add endpoint to mark all notifications as read
This commit is contained in:
@ -97,3 +97,11 @@ func MarkNotificationAsRead(s *xorm.Session, notification *DatabaseNotification,
|
||||
Update(notification)
|
||||
return
|
||||
}
|
||||
|
||||
func MarkAllNotificationsAsRead(s *xorm.Session, userID int64) (err error) {
|
||||
_, err = s.
|
||||
Where("notifiable_id = ?", userID).
|
||||
Cols("read_at").
|
||||
Update(&DatabaseNotification{ReadAt: time.Now()})
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user