server: order docs

This commit is contained in:
fantasticit 2022-06-05 21:11:11 +08:00
parent 287fdb3a66
commit 73deb5e54e
2 changed files with 6 additions and 0 deletions

View File

@ -563,6 +563,8 @@ export class DocumentService {
return lodash.omit(item, ['content', 'state']); return lodash.omit(item, ['content', 'state']);
}); });
docs.sort((a, b) => a.index - b.index);
// const docsWithCreateUser = await Promise.all( // const docsWithCreateUser = await Promise.all(
// docs.map(async (doc) => { // docs.map(async (doc) => {
// const createUser = await this.userService.findById(doc.createUserId); // const createUser = await this.userService.findById(doc.createUserId);
@ -617,6 +619,8 @@ export class DocumentService {
return lodash.omit(item, ['content', 'state']); return lodash.omit(item, ['content', 'state']);
}); });
docs.sort((a, b) => a.index - b.index);
// const docsWithCreateUser = await Promise.all( // const docsWithCreateUser = await Promise.all(
// docs.map(async (doc) => { // docs.map(async (doc) => {
// const createUser = await this.userService.findById(doc.createUserId); // const createUser = await this.userService.findById(doc.createUserId);

View File

@ -622,6 +622,8 @@ export class WikiService {
return lodash.omit(item, ['content', 'state']); return lodash.omit(item, ['content', 'state']);
}); });
docs.sort((a, b) => a.index - b.index);
const docsWithCreateUser = await Promise.all( const docsWithCreateUser = await Promise.all(
docs.map(async (doc) => { docs.map(async (doc) => {
const createUser = await this.userService.findById(doc.createUserId); const createUser = await this.userService.findById(doc.createUserId);