port push notifications in api v3
This commit is contained in:
@@ -21,7 +21,8 @@ import { removeFromArray } from '../../libs/api-v3/collectionManipulators';
|
||||
import * as firebase from '../../libs/api-v3/firebase';
|
||||
import { sendTxn as sendTxnEmail } from '../../libs/api-v3/email';
|
||||
import { encrypt } from '../../libs/api-v3/encryption';
|
||||
|
||||
import common from '../../../../common';
|
||||
import { sendNotification as sendPushNotification } from '../../libs/api-v3/pushNotifications';
|
||||
let api = {};
|
||||
|
||||
// TODO shall we accept party as groupId in all routes?
|
||||
@@ -510,6 +511,12 @@ async function _inviteByUUID (uuid, group, inviter, req, res) {
|
||||
sendTxnEmail(userToInvite, `invited-${groupLabel}`, emailVars);
|
||||
}
|
||||
|
||||
sendPushNotification(
|
||||
userToInvite,
|
||||
common.i18n.t(group.type === 'guild' ? 'invitedGuild' : 'invitedParty'),
|
||||
group.name
|
||||
);
|
||||
|
||||
let userInvited = await userToInvite.save();
|
||||
if (group.type === 'guild') {
|
||||
return userInvited.invitations.guilds[userToInvite.invitations.guilds.length - 1];
|
||||
|
||||
Reference in New Issue
Block a user