Procházet zdrojové kódy

fix result.createdPage to createdPage

zahmis před 5 roky
rodič
revize
9ad2bfab83
1 změnil soubory, kde provedl 4 přidání a 4 odebrání
  1. 4 4
      src/server/routes/apiv3/pages.js

+ 4 - 4
src/server/routes/apiv3/pages.js

@@ -228,13 +228,13 @@ module.exports = (crowi) => {
 
 
     // update scopes for descendants
     // update scopes for descendants
     if (overwriteScopesOfDescendants) {
     if (overwriteScopesOfDescendants) {
-      Page.applyScopesToDescendantsAsyncronously(result.createdPage, req.user);
+      Page.applyScopesToDescendantsAsyncronously(createdPage, req.user);
     }
     }
 
 
     // global notification
     // global notification
     if (globalNotificationService != null) {
     if (globalNotificationService != null) {
       try {
       try {
-        await globalNotificationService.fire(GlobalNotificationSetting.EVENT.PAGE_CREATE, result.createdPage, req.user);
+        await globalNotificationService.fire(GlobalNotificationSetting.EVENT.PAGE_CREATE, createdPage, req.user);
       }
       }
       catch (err) {
       catch (err) {
         logger.error('Create grobal notification failed', err);
         logger.error('Create grobal notification failed', err);
@@ -244,7 +244,7 @@ module.exports = (crowi) => {
     // user notification
     // user notification
     if (isSlackEnabled && userNotificationService != null) {
     if (isSlackEnabled && userNotificationService != null) {
       try {
       try {
-        const results = await userNotificationService.fire(result.createdPage, req.user, slackChannels, 'create', false);
+        const results = await userNotificationService.fire(createdPage, req.user, slackChannels, 'create', false);
         results.forEach((result) => {
         results.forEach((result) => {
           if (result.status === 'rejected') {
           if (result.status === 'rejected') {
             logger.error('Create user notification failed', result.reason);
             logger.error('Create user notification failed', result.reason);
@@ -510,7 +510,7 @@ module.exports = (crowi) => {
     // global notification
     // global notification
     if (globalNotificationService != null) {
     if (globalNotificationService != null) {
       try {
       try {
-        await globalNotificationService.fire(GlobalNotificationSetting.EVENT.PAGE_CREATE, result.createdPage, req.user);
+        await globalNotificationService.fire(GlobalNotificationSetting.EVENT.PAGE_CREATE, createdPage, req.user);
       }
       }
       catch (err) {
       catch (err) {
         logger.error('Create grobal notification failed', err);
         logger.error('Create grobal notification failed', err);