Add notifications to user when a follow profile posted

This commit is contained in:
Adolfo Reyna
2024-12-31 16:28:31 -05:00
parent 433f3069b3
commit d79138fba6
3 changed files with 30 additions and 2 deletions

View File

@@ -163,9 +163,12 @@ DB.getDB.then((DB) => {
post = postObj.toObj();
post._id = dbr.insertedId;
if ((post.toProfile && post.toProfile != post.profileid) || post.nonOrganicType == 'News') {
Notifications.youGotANewPost(post);
await Notifications.youGotANewPost(post);
}
await Notifications.yourGroupMakeANewPost(post);
if(!isGroupPrivate){
await Notifications.yourSubscriptionProfileHasNewPost(post);
}
Notifications.yourGroupGotANewPost(post);
return res.json({
status: "ok",
...post