mirror of
https://github.com/go-gitea/gitea
synced 2024-08-19 05:40:43 +02:00
make pagination optional for notifications (#10714)
This commit is contained in:
parent
dfca884b15
commit
49f8b20570
@ -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
|
// 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 {
|
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) {
|
func getNotifications(e Engine, options FindNotificationOptions) (nl NotificationList, err error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user