Folders: Add pagination to list (#102334)

This commit is contained in:
Stephanie Hingtgen
2025-03-18 04:56:06 -06:00
committed by GitHub
parent ba44ceb4b2
commit c79c768421
6 changed files with 105 additions and 8 deletions

View File

@ -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`)
}