mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +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:
@@ -19,9 +19,8 @@ import paypalPayments from '../../libs/paypalPayments';
|
||||
const daysSince = common.daysSince;
|
||||
|
||||
schema.methods.isSubscribed = function isSubscribed () {
|
||||
let now = new Date();
|
||||
let plan = this.purchased.plan;
|
||||
|
||||
const now = new Date();
|
||||
const plan = this.purchased.plan;
|
||||
return plan && plan.customerId && (!plan.dateTerminated || moment(plan.dateTerminated).isAfter(now));
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user