fix(delete account): allow deleting account after they've canceled
subscription, before it terminates
This commit is contained in:
@@ -258,7 +258,8 @@ api.cron = function(req, res, next) {
|
||||
// api.reset // Shared.ops
|
||||
|
||||
api['delete'] = function(req, res, next) {
|
||||
if (res.locals.user.purchased.plan.customerId)
|
||||
var plan = res.locals.user.purchased.plan;
|
||||
if (plan && plan.customerId && !plan.dateTerminated)
|
||||
return res.json(400,{err:"You have an active subscription, cancel your plan before deleting your account."});
|
||||
res.locals.user.remove(function(err){
|
||||
if (err) return next(err);
|
||||
|
||||
Reference in New Issue
Block a user