v3: iap accessible under /api/v3, fixes to spells and groups invitations

This commit is contained in:
Matteo Pagliazzi
2016-05-19 22:43:11 +02:00
parent c6da283b54
commit 5ba33bc5a1
3 changed files with 10 additions and 2 deletions

View File

@@ -513,6 +513,7 @@ async function _inviteByUUID (uuid, group, inviter, req, res) {
}
let groupLabel = group.type === 'guild' ? 'Guild' : 'Party';
let groupTemplate = group.type === 'guild' ? 'guild' : 'party';
if (userToInvite.preferences.emailNotifications[`invited${groupLabel}`] !== false) {
let emailVars = [
{name: 'INVITER', content: inviter.profile.name},
@@ -530,7 +531,7 @@ async function _inviteByUUID (uuid, group, inviter, req, res) {
);
}
sendTxnEmail(userToInvite, `invited-${groupLabel}`, emailVars);
sendTxnEmail(userToInvite, `invited-${groupTemplate}`, emailVars);
}
sendPushNotification(

View File

@@ -0,0 +1,4 @@
// NOTE: this file is only used because the mobile apps expect IAP routes
// to be found at /api/v3/iap instead of /iap.
module.exports = require('../top-level/payments/iap');

View File

@@ -378,7 +378,10 @@ api.castSpell = {
spell.cast(user, tasks, req);
let toSave = tasks.filter(t => t.isModified());
let toSave = tasks
.filter(t => t.isModified())
.map(t => t.save());
toSave.unshift(user.save());
let saved = await Bluebird.all(toSave);