mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 13:47:33 +01:00
api: fix notifications update
This commit is contained in:
@@ -631,7 +631,7 @@ api.joinGroup = {
|
||||
|
||||
if (group.type === 'party' && inviter) {
|
||||
if (group.memberCount > 1) {
|
||||
const notif = new UserNotification({ type: 'ACHIEVEMENT_PARTY_UP' });
|
||||
const notification = new UserNotification({ type: 'ACHIEVEMENT_PARTY_UP' });
|
||||
|
||||
promises.push(User.update(
|
||||
{
|
||||
@@ -640,7 +640,7 @@ api.joinGroup = {
|
||||
},
|
||||
{
|
||||
$set: { 'achievements.partyUp': true },
|
||||
$push: { notifications: notif },
|
||||
$push: { notifications: notification.toObject() },
|
||||
},
|
||||
{ multi: true },
|
||||
).exec());
|
||||
@@ -655,7 +655,7 @@ api.joinGroup = {
|
||||
}
|
||||
|
||||
if (group.memberCount > 3) {
|
||||
const notif = new UserNotification({ type: 'ACHIEVEMENT_PARTY_ON' });
|
||||
const notification = new UserNotification({ type: 'ACHIEVEMENT_PARTY_ON' });
|
||||
|
||||
promises.push(User.update(
|
||||
{
|
||||
@@ -664,7 +664,7 @@ api.joinGroup = {
|
||||
},
|
||||
{
|
||||
$set: { 'achievements.partyOn': true },
|
||||
$push: { notifications: notif },
|
||||
$push: { notifications: notification.toObject() },
|
||||
},
|
||||
{ multi: true },
|
||||
).exec());
|
||||
|
||||
Reference in New Issue
Block a user