|
@@ -183,7 +183,6 @@ module.exports = function(crowi, app) {
|
|
|
Page.findPage(path, req.user, req.query.revision)
|
|
Page.findPage(path, req.user, req.query.revision)
|
|
|
.then(function(page) {
|
|
.then(function(page) {
|
|
|
debug('Page found', page._id, page.path);
|
|
debug('Page found', page._id, page.path);
|
|
|
- debug(page);
|
|
|
|
|
|
|
|
|
|
if (isMarkdown) {
|
|
if (isMarkdown) {
|
|
|
res.set('Content-Type', 'text/plain');
|
|
res.set('Content-Type', 'text/plain');
|
|
@@ -228,6 +227,7 @@ module.exports = function(crowi, app) {
|
|
|
var redirectPath = encodeURI(path);
|
|
var redirectPath = encodeURI(path);
|
|
|
var pageData = {};
|
|
var pageData = {};
|
|
|
var updateOrCreate;
|
|
var updateOrCreate;
|
|
|
|
|
+ var previousRevision = false;
|
|
|
|
|
|
|
|
// set to render
|
|
// set to render
|
|
|
res.locals.pageForm = pageForm;
|
|
res.locals.pageForm = pageForm;
|
|
@@ -254,6 +254,7 @@ module.exports = function(crowi, app) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (data) {
|
|
if (data) {
|
|
|
|
|
+ previousRevision = data.revision;
|
|
|
// update existing page
|
|
// update existing page
|
|
|
var newRevision = Revision.prepareRevision(data, body, req.user);
|
|
var newRevision = Revision.prepareRevision(data, body, req.user);
|
|
|
updateOrCreate = 'update';
|
|
updateOrCreate = 'update';
|
|
@@ -277,7 +278,7 @@ module.exports = function(crowi, app) {
|
|
|
|
|
|
|
|
if (crowi.slack) {
|
|
if (crowi.slack) {
|
|
|
notify.slack.channel.split(',').map(function(chan) {
|
|
notify.slack.channel.split(',').map(function(chan) {
|
|
|
- var message = crowi.slack.prepareSlackMessage(pageData, req.user, chan, updateOrCreate);
|
|
|
|
|
|
|
+ var message = crowi.slack.prepareSlackMessage(pageData, req.user, chan, updateOrCreate, previousRevision);
|
|
|
crowi.slack.post(message).then(function(){}).catch(function(){});
|
|
crowi.slack.post(message).then(function(){}).catch(function(){});
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|