Răsfoiți Sursa

call static function deleteAllByPageActionType in page service init

yohei0125 3 ani în urmă
părinte
comite
140d59531a
1 a modificat fișierele cu 7 adăugiri și 1 ștergeri
  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 { pagePathUtils } from '@growi/core';
 
 
-import PageOperation from '~/server/models/page-operation';
+import PageOperation, { PageActionType } from '~/server/models/page-operation';
 
 
 const { isEitherOfPathAreaOverlap, isPathAreaOverlap, isTrashPage } = pagePathUtils;
 const { isEitherOfPathAreaOverlap, isPathAreaOverlap, isTrashPage } = pagePathUtils;
 
 
@@ -12,6 +12,12 @@ class PageOperationService {
     this.crowi = crowi;
     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
    * Check if the operation is operatable
    * @param isRecursively Boolean that determines whether the operation is recursive or not
    * @param isRecursively Boolean that determines whether the operation is recursive or not