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

+ 4 - 6
packages/app/src/server/routes/apiv3/bookmarks.js

@@ -262,6 +262,10 @@ module.exports = (crowi) => {
       }
       if (bool) {
         bookmark = await Bookmark.add(page, req.user);
+
+        const pageEvent = crowi.event('page');
+        // in-app notification
+        pageEvent.emit('bookmark', page, req.user);
       }
       else {
         bookmark = await Bookmark.removeBookmark(page, req.user);
@@ -272,12 +276,6 @@ module.exports = (crowi) => {
       return res.apiv3Err(err, 500);
     }
 
-    if (bool) {
-      const pageEvent = crowi.event('page');
-      // in-app notification
-      pageEvent.emit('bookmark', page, req.user);
-    }
-
     bookmark.depopulate('page');
     bookmark.depopulate('user');