|
@@ -16,7 +16,8 @@ module.exports = function(crowi, app) {
|
|
|
, pagePathUtil = require('../util/pagePathUtil')
|
|
, pagePathUtil = require('../util/pagePathUtil')
|
|
|
, swig = require('swig-templates')
|
|
, swig = require('swig-templates')
|
|
|
, getToday = require('../util/getToday')
|
|
, getToday = require('../util/getToday')
|
|
|
- , notification = require('../service/global-notification')
|
|
|
|
|
|
|
+ , globalNotification = require('../service/global-notification')
|
|
|
|
|
+ , notification = new globalNotification(crowi)
|
|
|
|
|
|
|
|
, actions = {};
|
|
, actions = {};
|
|
|
|
|
|
|
@@ -704,11 +705,14 @@ module.exports = function(crowi, app) {
|
|
|
|
|
|
|
|
if (data) {
|
|
if (data) {
|
|
|
previousRevision = data.revision;
|
|
previousRevision = data.revision;
|
|
|
- return Page.updatePage(data, body, req.user, { grant, grantUserGroupId });
|
|
|
|
|
- // .then(() => {
|
|
|
|
|
- // // NOTIFICATION: send page edit notification here
|
|
|
|
|
- // notification.sendPageEditNotification(page);
|
|
|
|
|
- // })
|
|
|
|
|
|
|
+ return Page.updatePage(data, body, req.user, { grant, grantUserGroupId })
|
|
|
|
|
+ .then((page) => {
|
|
|
|
|
+ // NOTIFICATION: send page edit notification here
|
|
|
|
|
+ notification.notifyPageEdit(page);
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((err) => {
|
|
|
|
|
+ console.log('error');
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
// new page
|
|
// new page
|
|
@@ -716,7 +720,7 @@ module.exports = function(crowi, app) {
|
|
|
return Page.create(path, body, req.user, { grant, grantUserGroupId });
|
|
return Page.create(path, body, req.user, { grant, grantUserGroupId });
|
|
|
// .then((page) => {
|
|
// .then((page) => {
|
|
|
// // NOTIFICATION: send page create notification here
|
|
// // NOTIFICATION: send page create notification here
|
|
|
- // notification.sendPageCreateNotification(page);
|
|
|
|
|
|
|
+ // notification.notifyPageCreate(page);
|
|
|
// })
|
|
// })
|
|
|
}
|
|
}
|
|
|
}).then(function(data) {
|
|
}).then(function(data) {
|