mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-14 07:52:15 +00:00
fix promo gifting
This commit is contained in:
parent
53bbd93d80
commit
6988875e8a
1 changed files with 10 additions and 3 deletions
|
|
@ -426,9 +426,16 @@ api.createSubscription = async function createSubscription (data) {
|
|||
}
|
||||
|
||||
if (data.gift.member._id !== data.user._id) { // If sending to a user other than yourself, don't push notify, and get bonus sub for self per holiday promo
|
||||
let promoData = data;
|
||||
promoData.gift.member = data.user;
|
||||
promoData.promo = 'Winter';
|
||||
let promoData = {
|
||||
user: data.user,
|
||||
gift: {
|
||||
member: data.user,
|
||||
subscription: {
|
||||
key: data.gift.subscription.key,
|
||||
},
|
||||
},
|
||||
promo: 'Winter',
|
||||
};
|
||||
await this.createSubscription(promoData);
|
||||
|
||||
if (data.gift.member.preferences.pushNotifications.giftedSubscription !== false) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue