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