Skip to content

Commit dac4fbc

Browse files
committed
make pagination optional for notificatins
1 parent 12960b9 commit dac4fbc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

models/notification.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,11 @@ func (opts *FindNotificationOptions) ToCond() builder.Cond {
103103

104104
// ToSession will convert the given options to a xorm Session by using the conditions from ToCond and joining with issue table if required
105105
func (opts *FindNotificationOptions) ToSession(e Engine) *xorm.Session {
106-
return opts.setSessionPagination(e.Where(opts.ToCond()))
106+
sess := e.Where(opts.ToCond())
107+
if opts.Page != 0 {
108+
sess = opts.setSessionPagination(sess)
109+
}
110+
return sess
107111
}
108112

109113
func getNotifications(e Engine, options FindNotificationOptions) (nl NotificationList, err error) {

0 commit comments

Comments
 (0)