From 132951c525028c74ce46c9f7f4bbf6f8bc5080a3 Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Fri, 6 Dec 2019 13:03:05 +0100 Subject: [PATCH] Update handleContentDataOfPost to return post - fix tests, functionality --- .../src/middleware/notifications/notificationsMiddleware.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/middleware/notifications/notificationsMiddleware.js b/backend/src/middleware/notifications/notificationsMiddleware.js index 3d6d13790..564ddc370 100644 --- a/backend/src/middleware/notifications/notificationsMiddleware.js +++ b/backend/src/middleware/notifications/notificationsMiddleware.js @@ -100,7 +100,8 @@ const notifyUsers = async (label, id, idsOfUsers, reason, context) => { const handleContentDataOfPost = async (resolve, root, args, context, resolveInfo) => { const idsOfUsers = extractMentionedUsers(args.content) const post = await resolve(root, args, context, resolveInfo) - if (post) return notifyUsers('Post', post.id, idsOfUsers, 'mentioned_in_post', context) + if (post) await notifyUsers('Post', post.id, idsOfUsers, 'mentioned_in_post', context) + return post } const handleContentDataOfComment = async (resolve, root, args, context, resolveInfo) => {