Просмотр исходного кода

return the response before sending the global notification

Shun Miyazawa 4 лет назад
Родитель
Сommit
b070249020
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      packages/app/src/server/routes/apiv3/pages.js

+ 2 - 2
packages/app/src/server/routes/apiv3/pages.js

@@ -295,6 +295,8 @@ module.exports = (crowi) => {
       Page.applyScopesToDescendantsAsyncronously(createdPage, req.user);
     }
 
+    res.apiv3(result, 201);
+
     try {
       // global notification
       await globalNotificationService.fire(GlobalNotificationSetting.EVENT.PAGE_CREATE, createdPage, req.user);
@@ -325,8 +327,6 @@ module.exports = (crowi) => {
     catch (err) {
       logger.error('Failed to create subscription document', err);
     }
-
-    return res.apiv3(result, 201);
   });