|
@@ -237,14 +237,12 @@ module.exports = (crowi) => {
|
|
|
Page.applyScopesToDescendantsAsyncronously(createdPage, req.user);
|
|
Page.applyScopesToDescendantsAsyncronously(createdPage, req.user);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // global notification
|
|
|
|
|
- if (globalNotificationService != null) {
|
|
|
|
|
- try {
|
|
|
|
|
- await globalNotificationService.fire(GlobalNotificationSetting.EVENT.PAGE_CREATE, createdPage, req.user);
|
|
|
|
|
- }
|
|
|
|
|
- catch (err) {
|
|
|
|
|
- logger.error('Create grobal notification failed', err);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ try {
|
|
|
|
|
+ // global notification
|
|
|
|
|
+ await globalNotificationService.fire(GlobalNotificationSetting.EVENT.PAGE_CREATE, createdPage, req.user);
|
|
|
|
|
+ }
|
|
|
|
|
+ catch (err) {
|
|
|
|
|
+ logger.error('Create grobal notification failed', err);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// user notification
|
|
// user notification
|
|
@@ -493,14 +491,12 @@ module.exports = (crowi) => {
|
|
|
const originTags = await page.findRelatedTagsById();
|
|
const originTags = await page.findRelatedTagsById();
|
|
|
const savedTags = await saveTagsAction({ page, createdPage, pageTags: originTags });
|
|
const savedTags = await saveTagsAction({ page, createdPage, pageTags: originTags });
|
|
|
|
|
|
|
|
- // global notification
|
|
|
|
|
- if (globalNotificationService != null) {
|
|
|
|
|
- try {
|
|
|
|
|
- await globalNotificationService.fire(GlobalNotificationSetting.EVENT.PAGE_CREATE, createdPage, user);
|
|
|
|
|
- }
|
|
|
|
|
- catch (err) {
|
|
|
|
|
- logger.error('Create grobal notification failed', err);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ try {
|
|
|
|
|
+ // global notification
|
|
|
|
|
+ await globalNotificationService.fire(GlobalNotificationSetting.EVENT.PAGE_CREATE, createdPage, user);
|
|
|
|
|
+ }
|
|
|
|
|
+ catch (err) {
|
|
|
|
|
+ logger.error('Create grobal notification failed', err);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return { page: pageService.serializeToObj(createdPage), tags: savedTags };
|
|
return { page: pageService.serializeToObj(createdPage), tags: savedTags };
|