diff --git a/lib/customers.js b/lib/customers.js index 1ba9e8c0..1f15dc91 100644 --- a/lib/customers.js +++ b/lib/customers.js @@ -88,7 +88,7 @@ function update (id, data, userToken, txId) { ' where id=$1 returning *' return db.one(sql, [id]) - .then(customerData => { + .then(customerData => { return getEditedData(id) .then(customerEditedData => selectLatestData(customerData, customerEditedData)) }) diff --git a/lib/routes/phoneCodeRoutes.js b/lib/routes/phoneCodeRoutes.js index b14a946b..ac92531f 100644 --- a/lib/routes/phoneCodeRoutes.js +++ b/lib/routes/phoneCodeRoutes.js @@ -26,10 +26,8 @@ function addOrUpdateCustomer (req) { return add(req.body) }) - .then(customer => { - return Promise.all([getEditedData(customer.id), getCustomerById(customer.id)]) - .then(([customerEditedData, customerOriginalData]) => selectLatestData(customerOriginalData, customerEditedData)) - }) + .then(customer => Promise.all([getEditedData(customer.id), getCustomerById(customer.id)])) + .then(([customerEditedData, customerOriginalData]) => selectLatestData(customerOriginalData, customerEditedData)) .then(customer => { // BACKWARDS_COMPATIBILITY 7.5 // machines before 7.5 expect customer with sanctions result