kaori 4 years ago
parent
commit
4255129638

+ 6 - 4
packages/app/src/server/service/comment.ts

@@ -1,8 +1,8 @@
 import loggerFactory from '../../utils/logger';
 import { getModelSafely } from '../util/mongoose-utils';
 
-const InAppNotificationService = require('./in-app-notification');
-const ActivityService = require('./activity');
+// const InAppNotificationService = require('./in-app-notification');
+// const ActivityService = require('./activity');
 
 const logger = loggerFactory('growi:service:CommentService');
 
@@ -51,8 +51,10 @@ class CommentService {
     this.commentEvent.on('remove', async(comment) => {
       this.commentEvent.onRemove();
 
-      const { activityService, inAppNotificationService } = this.crowi;
-      console.log('inAppNotificationServiceFUga', inAppNotificationService);
+      const { activityService } = this.crowi;
+
+      console.log('this.crowiFUga', this.crowi);
+      // console.log('activityServiceFUga', activityService);
 
       try {
         // TODO: Able to remove child activities of comment by GW-7510

+ 5 - 8
packages/app/src/server/service/page.js

@@ -19,20 +19,17 @@ class PageService {
 
   constructor(crowi) {
     this.crowi = crowi;
-    // this.activityService = this.crowi.activityService;
     this.pageEvent = crowi.event('page');
 
-    // this.pageEvent.on('create', this.pageEvent.onCreate);
-    // this.pageEvent.on('update', this.pageEvent.onUpdate);
-    // this.pageEvent.on('createMany', this.pageEvent.onCreateMany);
-
     // init
     this.initPageEvent();
   }
 
-  async initPageEvent() {
+  initPageEvent() {
     console.log('this.crowi.hoge', this.crowi);
-    const { activityService } = this.crowi;
+    const { activityService, commentService, slackIntegrationService } = this.crowi;
+    // console.log('commentServiceHoge', commentService);
+    console.log('slackIntegrationServiceHoge', slackIntegrationService);
 
     // create
     this.pageEvent.on('create', this.pageEvent.onCreate);
@@ -42,7 +39,7 @@ class PageService {
       this.pageEvent.onUpdate();
 
       try {
-        console.log('activityServiceHoge', activityService);
+        // console.log('activityServiceHoge', activityService);
         const activityLog = await activityService.createByPageUpdate(page, user);
         logger.info('Activity created', activityLog);
       }