🐛 Fixing pagination for "Shared with me"/ES (#778)

This commit is contained in:
Montassar Ghanmy
2025-01-08 17:58:01 +01:00
committed by GitHub
parent f04e5f0535
commit fd0ff703b6
10 changed files with 78 additions and 16 deletions
@@ -133,6 +133,9 @@ export class DocumentsService {
options.sort = this.getSortFieldMapping(options.sort);
}
// Handle pagination differently for non-MongoDB platforms
globalResolver.platformServices.search.handlePagination(options);
const fileList: ListResult<DriveFile> = await this.search(options, context);
const result = fileList.getEntities();
@@ -57,12 +57,18 @@ export type SearchDocumentsOptions = {
onlyDirectlyShared?: boolean;
onlyUploadedNotByMe?: boolean;
pagination?: Paginable;
nextPage?: {
page_token: string;
};
};
export type BrowseDocumentsOptions = {
filter?: SearchDocumentsBody;
sort?: SortType;
paginate?: Paginable;
nextPage?: {
page_token: string;
};
};
export type SearchDocumentsBody = {
@@ -213,6 +213,7 @@ export class DocumentsController {
onlyUploadedNotByMe: true,
sort: request.body.sort,
pagination: request.body.paginate,
nextPage: request.body.nextPage,
};
return {