mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Updated plan updated date if user has cancelled (#9773)
* Updated plan updated date if user has cancelled * Added test for plan with only date updated
This commit is contained in:
@@ -307,7 +307,7 @@ api.createSubscription = async function createSubscription (data) {
|
||||
if (plan.customerId && !plan.dateTerminated) { // User has active plan
|
||||
plan.extraMonths += months;
|
||||
} else {
|
||||
if (!plan.dateUpdated) plan.dateUpdated = today;
|
||||
if (!recipient.isSubscribed() || !plan.dateUpdated) plan.dateUpdated = today;
|
||||
if (moment(plan.dateTerminated).isAfter()) {
|
||||
plan.dateTerminated = moment(plan.dateTerminated).add({months}).toDate();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user