From 08bd7da33f238602716ccf07b5c23c7c5fa4f2e7 Mon Sep 17 00:00:00 2001 From: Josh Harvey Date: Fri, 8 Sep 2017 15:38:31 +0300 Subject: [PATCH] fix phoneCode bug --- lib/routes.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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}))