Browse Source

make pagination optional for notifications (#10714)

for-closed-social
6543 4 years ago
committed by GitHub
parent
commit
49f8b20570
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      models/notification.go

+ 5
- 1
models/notification.go View File

@ -103,7 +103,11 @@ func (opts *FindNotificationOptions) ToCond() builder.Cond {
// ToSession will convert the given options to a xorm Session by using the conditions from ToCond and joining with issue table if required
func (opts *FindNotificationOptions) ToSession(e Engine) *xorm.Session {
return opts.setSessionPagination(e.Where(opts.ToCond()))
sess := e.Where(opts.ToCond())
if opts.Page != 0 {
sess = opts.setSessionPagination(sess)
}
return sess
}
func getNotifications(e Engine, options FindNotificationOptions) (nl NotificationList, err error) {

Loading…
Cancel
Save