Просмотр исходного кода

inject process ifno to into pages

yohei0125 3 лет назад
Родитель
Сommit
2beb584986
1 измененных файлов с 7 добавлено и 2 удалено
  1. 7 2
      packages/app/src/server/service/page.ts

+ 7 - 2
packages/app/src/server/service/page.ts

@@ -3472,11 +3472,14 @@ class PageService {
     }
     }
     await queryBuilder.addViewerCondition(user, userGroups);
     await queryBuilder.addViewerCondition(user, userGroups);
 
 
-    return queryBuilder
+    const _pages = await queryBuilder
       .addConditionToSortPagesByAscPath()
       .addConditionToSortPagesByAscPath()
       .query
       .query
       .lean()
       .lean()
       .exec();
       .exec();
+
+    return this.injectProcessInfoIntoPagesByActionTypes(_pages, [PageActionType.Rename]);
+
   }
   }
 
 
   async findAncestorsChildrenByPathAndViewer(path: string, user, userGroups = null): Promise<Record<string, PageDocument[]>> {
   async findAncestorsChildrenByPathAndViewer(path: string, user, userGroups = null): Promise<Record<string, PageDocument[]>> {
@@ -3496,13 +3499,15 @@ class PageService {
       .lean()
       .lean()
       .exec();
       .exec();
     // mark target
     // mark target
-    const pages = _pages.map((page: PageDocument & { isTarget?: boolean }) => {
+    const markedPages = _pages.map((page: PageDocument & { isTarget?: boolean }) => {
       if (page.path === path) {
       if (page.path === path) {
         page.isTarget = true;
         page.isTarget = true;
       }
       }
       return page;
       return page;
     });
     });
 
 
+    const pages = await this.injectProcessInfoIntoPagesByActionTypes(markedPages, [PageActionType.Rename]);
+
     /*
     /*
      * If any non-migrated page is found during creating the pathToChildren map, it will stop incrementing at that moment
      * If any non-migrated page is found during creating the pathToChildren map, it will stop incrementing at that moment
      */
      */