mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-13 07:18:38 +00:00
fix(cron): plan check so it passes tests
This commit is contained in:
parent
a68c3c3dad
commit
c72c8a948f
1 changed files with 2 additions and 2 deletions
|
|
@ -1270,8 +1270,8 @@ api.wrap = (user, main=true) ->
|
|||
|
||||
|
||||
# If user cancelled subscription, we give them until 30day's end until it terminates
|
||||
plan = user.purchased.plan
|
||||
if plan.customerId && plan.dateTerminated && moment(plan.dateTerminated).isBefore(+new Date)
|
||||
plan = user.purchased?.plan
|
||||
if plan && plan.customerId && plan.dateTerminated && moment(plan.dateTerminated).isBefore(+new Date)
|
||||
_.merge user.purchased.plan, {planId:null, customerId:null, paymentMethod:null}
|
||||
user.markModified 'purchased.plan'
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue