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

Merge pull request #5546 from weseek/imprv/empty-page-operation-collection

imprv: empty page operation collection
Yohei Shiina 4 лет назад
Родитель
Сommit
a732025d1a
2 измененных файлов с 6 добавлено и 2 удалено
  1. 2 0
      packages/app/src/server/crowi/index.js
  2. 4 2
      packages/app/src/server/service/page-operation.ts

+ 2 - 0
packages/app/src/server/crowi/index.js

@@ -682,6 +682,8 @@ Crowi.prototype.setupPageService = async function() {
   }
   }
   if (this.pageOperationService == null) {
   if (this.pageOperationService == null) {
     this.pageOperationService = new PageOperationService(this);
     this.pageOperationService = new PageOperationService(this);
+    // TODO: Remove this code when resuming feature is implemented
+    await this.pageOperationService.init();
   }
   }
 };
 };
 
 

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

@@ -10,9 +10,11 @@ class PageOperationService {
 
 
   constructor(crowi) {
   constructor(crowi) {
     this.crowi = crowi;
     this.crowi = crowi;
+  }
 
 
-    // TODO: Remove this code when resuming feature is implemented
-    PageOperation.deleteMany({});
+  // TODO: Remove this code when resuming feature is implemented
+  async init():Promise<void> {
+    await PageOperation.deleteMany({});
   }
   }
 
 
   /**
   /**