mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 05:37:53 +08:00
Folders: Add pagination to list (#102334)
This commit is contained in:

committed by
GitHub

parent
ba44ceb4b2
commit
c79c768421
@ -498,7 +498,11 @@ func (ss *FolderStoreImpl) GetFolders(ctx context.Context, q folder.GetFoldersFr
|
||||
}
|
||||
|
||||
if len(q.AncestorUIDs) == 0 {
|
||||
if q.OrderByTitle {
|
||||
if q.Limit > 0 {
|
||||
s.WriteString(` ORDER BY f0.title ASC`)
|
||||
s.WriteString(` LIMIT ? OFFSET ?`)
|
||||
args = append(args, q.Limit, (q.Page-1)*q.Limit)
|
||||
} else if q.OrderByTitle {
|
||||
s.WriteString(` ORDER BY f0.title ASC`)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user