diff --git a/packages/server/src/services/document.service.ts b/packages/server/src/services/document.service.ts index 59a9a5f..f5d5187 100644 --- a/packages/server/src/services/document.service.ts +++ b/packages/server/src/services/document.service.ts @@ -563,6 +563,8 @@ export class DocumentService { return lodash.omit(item, ['content', 'state']); }); + docs.sort((a, b) => a.index - b.index); + // const docsWithCreateUser = await Promise.all( // docs.map(async (doc) => { // const createUser = await this.userService.findById(doc.createUserId); @@ -617,6 +619,8 @@ export class DocumentService { return lodash.omit(item, ['content', 'state']); }); + docs.sort((a, b) => a.index - b.index); + // const docsWithCreateUser = await Promise.all( // docs.map(async (doc) => { // const createUser = await this.userService.findById(doc.createUserId); diff --git a/packages/server/src/services/wiki.service.ts b/packages/server/src/services/wiki.service.ts index af72aa8..349a530 100644 --- a/packages/server/src/services/wiki.service.ts +++ b/packages/server/src/services/wiki.service.ts @@ -622,6 +622,8 @@ export class WikiService { return lodash.omit(item, ['content', 'state']); }); + docs.sort((a, b) => a.index - b.index); + const docsWithCreateUser = await Promise.all( docs.map(async (doc) => { const createUser = await this.userService.findById(doc.createUserId);