Skip to content

Commit

Permalink
make pagination optional for notificatins
Browse files Browse the repository at this point in the history
  • Loading branch information
6543 committed Apr 18, 2020
1 parent 12960b9 commit dac4fbc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion models/notification.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit dac4fbc

Please sign in to comment.