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

call static function deleteAllByPageActionType in page service init

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

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

@@ -1,6 +1,6 @@
 import { pagePathUtils } from '@growi/core';
 
-import PageOperation from '~/server/models/page-operation';
+import PageOperation, { PageActionType } from '~/server/models/page-operation';
 
 const { isEitherOfPathAreaOverlap, isPathAreaOverlap, isTrashPage } = pagePathUtils;
 
@@ -12,6 +12,12 @@ class PageOperationService {
     this.crowi = crowi;
   }
 
+  // TODO: Remove this code when resuming feature is implemented
+  async init() {
+    const deleteTypes = Object.values(PageActionType).filter(type => type !== PageActionType.Rename);
+    await PageOperation.deleteAllByPageActionType(deleteTypes);
+  }
+
   /**
    * Check if the operation is operatable
    * @param isRecursively Boolean that determines whether the operation is recursive or not