diff --git a/notifications.js b/notifications.js index c432d61..f35a16a 100644 --- a/notifications.js +++ b/notifications.js @@ -186,7 +186,7 @@ const Notifications = { DB.addNotification(post.profileid, notifBody, postId, post.comments.length - 1); return youGotANewPostCommentTemplate(post, userEmail, postProfile, senderProfile, message); }, - async yourGroupGotANewPost(groupProfile, senderProfile, message) { + async yourGroupGotANewPost(groupProfile, senderProfile, message, post) { const DB = await DBGetter.getDB; let subscribedPromise = Object.keys(groupProfile.subscribed).map((profileid) => { return DB.getProfileCache(profileid); @@ -213,7 +213,7 @@ const Notifications = { const user = await DB.getUserById(profile.userid); const senderProfile = await DB.getProfileCache(whoPostedId); if (profile.isGroup) { - return this.yourGroupGotANewPost(profile, senderProfile, message); + return this.yourGroupGotANewPost(profile, senderProfile, message, post); } const notifBody = `${senderProfile.profile.firstName} post in your profile`; DB.addNotification(toProfileId, notifBody, post._id);