@@ -263,6 +263,11 @@ module.exports = (crowi) => {
logger.error('Like notification failed', err);
}
+
+ if (isLiked) {
+ const pageEvent = crowi.event('page');
+ pageEvent.emit('likes:notification', page, req.user);
+ }
});
/**
@@ -58,6 +58,11 @@ class PageService {
// createMany
this.pageEvent.on('createMany', this.pageEvent.onCreateMany);
+ // likes
+ this.pageEvent.on('likes:notification', async(page, user) => {
+ console.log('like event!!!');
+ });