fix: simplify promise chain
This commit is contained in:
parent
8fe9c2551a
commit
a28d7d1aab
2 changed files with 3 additions and 5 deletions
|
|
@ -26,10 +26,8 @@ function addOrUpdateCustomer (req) {
|
|||
|
||||
return add(req.body)
|
||||
})
|
||||
.then(customer => {
|
||||
return Promise.all([getEditedData(customer.id), getCustomerById(customer.id)])
|
||||
.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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue