1
0

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

This commit is contained in:
kolaente
2023-10-20 16:40:47 +02:00
parent 66cf7ab50a
commit 10c9913e12
4 changed files with 78 additions and 0 deletions

View File

@ -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
}