sou 7 سال پیش
والد
کامیت
151ccb0b77
1فایلهای تغییر یافته به همراه7 افزوده شده و 1 حذف شده
  1. 7 1
      lib/routes/comment.js

+ 7 - 1
lib/routes/comment.js

@@ -77,10 +77,16 @@ module.exports = function(crowi, app) {
     });
 
     // slack notification
+    // if (form.slackOn) {
     const slackNotify = new slack(crowi);
     const user = await User.findUserByUsername(req.user.username);
     const path = page.path;
-    await slackNotify.postComment(createdComment, user, 'general', path);
+    // const channels = form.channel;
+    const channels = 'general';
+    channels.split(',').map(function(chan) {
+      slackNotify.postComment(createdComment, user, chan, path);
+    });
+    // }
 
     return res.json(ApiResponse.success({comment: createdComment}));
   };