diff --git a/lib/routes.js b/lib/routes.js index f4a1eff3..b1c1a8b6 100644 --- a/lib/routes.js +++ b/lib/routes.js @@ -149,7 +149,8 @@ function getCustomerWithPhoneCode (req, res, next) { const phone = req.body.phone return pi.getPhoneCode(phone) .then(code => { - return customers.get(phone.phone).then(customer => { + return customers.get(phone) + .then(customer => { if (customer) return respond(req, res, {code, customer}) return customers.add(req.body) .then(customer => respond(req, res, {code, customer}))