Skip to content

Commit 36988a9

Browse files
Johan BookJohan Book
Johan Book
authored and
Johan Book
committed
feat(api): send notification to profiles that reacted to blog post
1 parent 2407c2d commit 36988a9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

services/api/src/features/blogs/application/handlers/event-handlers/notify-organization-on-posted-blog-post-comment.handler.ts

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export class NotifyOrganizationOnPostedBlogPostCommentHandler
4848
relations: {
4949
comments: true,
5050
profile: true,
51+
reactions: true,
5152
},
5253
where: {
5354
id: event.blogPostId,
@@ -69,6 +70,7 @@ export class NotifyOrganizationOnPostedBlogPostCommentHandler
6970
const profileIds = [
7071
blogPost.profileId,
7172
...blogPost.comments.map((comment) => comment.profileId),
73+
...blogPost.reactions.map(reaction => reaction.profileId),
7274
].filter((id) => id !== event.profileId);
7375

7476
await this.notificationService.notifyProfiles(profileIds, notification);

0 commit comments

Comments
 (0)