|
|
@@ -255,6 +255,10 @@ module.exports = (crowi) => {
|
|
|
res.apiv3({ result });
|
|
|
|
|
|
if (isLiked) {
|
|
|
+ const pageEvent = crowi.event('page');
|
|
|
+ // in-app notification
|
|
|
+ pageEvent.emit('like', page, req.user);
|
|
|
+
|
|
|
try {
|
|
|
// global notification
|
|
|
await globalNotificationService.fire(GlobalNotificationSetting.EVENT.PAGE_LIKE, page, req.user);
|
|
|
@@ -263,12 +267,6 @@ module.exports = (crowi) => {
|
|
|
logger.error('Like notification failed', err);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- if (isLiked) {
|
|
|
- const pageEvent = crowi.event('page');
|
|
|
- // in-app notification
|
|
|
- pageEvent.emit('like', page, req.user);
|
|
|
- }
|
|
|
});
|
|
|
|
|
|
/**
|