|
|
@@ -3,10 +3,9 @@ module.exports = function(crowi, app) {
|
|
|
|
|
|
const debug = require('debug')('growi:routs:comment')
|
|
|
, Comment = crowi.model('Comment')
|
|
|
- , User = crowi.model('User')
|
|
|
, Page = crowi.model('Page')
|
|
|
, ApiResponse = require('../util/apiResponse')
|
|
|
- , slack = require('../util/slack')
|
|
|
+ , slack = require('./slack')
|
|
|
, actions = {}
|
|
|
, api = {};
|
|
|
|
|
|
@@ -71,16 +70,12 @@ module.exports = function(crowi, app) {
|
|
|
});
|
|
|
|
|
|
// update page
|
|
|
- const page = await Page.findOneAndUpdate({ _id: pageId }, {
|
|
|
+ await Page.findOneAndUpdate({ _id: pageId }, {
|
|
|
lastUpdateUser: req.user,
|
|
|
updatedAt: new Date()
|
|
|
});
|
|
|
-
|
|
|
- //slack notification
|
|
|
- const slackNotify = new slack(crowi);
|
|
|
- const user = await User.findUserByUsername(req.user.username);
|
|
|
- await slackNotify.post(page, user, 'general', 'comment', null);
|
|
|
-
|
|
|
+ const s = new slack('adsf');
|
|
|
+ await s.send();
|
|
|
return res.json(ApiResponse.success({comment: createdComment}));
|
|
|
};
|
|
|
|