|
|
@@ -170,6 +170,10 @@ module.exports = SubscriptionController =
|
|
|
AuthenticationController.getLoggedInUser req, (error, user) ->
|
|
|
return next(error) if error?
|
|
|
planCode = req.body.plan_code
|
|
|
+ if !planCode?
|
|
|
+ err = new Error('plan_code not defined')
|
|
|
+ logger.err {user_id: user._id, err}, "error updating subscription"
|
|
|
+ return next(err)
|
|
|
logger.log planCode: planCode, user_id:user._id, "updating subscription"
|
|
|
SubscriptionHandler.updateSubscription user, planCode, null, (err)->
|
|
|
if err?
|