diff options
Diffstat (limited to 'models/notification.go')
-rw-r--r-- | models/notification.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/models/notification.go b/models/notification.go index c4c7728ad9..30bb7596a8 100644 --- a/models/notification.go +++ b/models/notification.go @@ -125,6 +125,11 @@ func GetNotifications(opts *FindNotificationOptions) (NotificationList, error) { return getNotifications(x, opts) } +// CountNotifications count all notifications that fit to the given options and ignore pagination. +func CountNotifications(opts *FindNotificationOptions) (int64, error) { + return x.Where(opts.ToCond()).Count(&Notification{}) +} + // CreateRepoTransferNotification creates notification for the user a repository was transferred to func CreateRepoTransferNotification(doer, newOwner *User, repo *Repository) error { sess := x.NewSession() |