Prevent compliance from triggering prematurely

This commit is contained in:
Rafael Taranto 2019-05-31 10:37:10 -03:00 committed by Josh Harvey
parent 09332c37db
commit 18bbfc6def
2 changed files with 12 additions and 8 deletions

View file

@ -221,6 +221,7 @@ function getCustomerWithPhoneCode (req, res, next) {
function updateCustomer (req, res, next) {
const id = req.params.id
const txId = req.query.txId
const patch = req.body
const config = configManager.unscoped(req.settings.config)
@ -232,7 +233,7 @@ function updateCustomer (req, res, next) {
return compliance.validationPatch(req.deviceId, config, mergedCustomer)
.then(_.merge(patch))
.then(newPatch => customers.updatePhotoCard(id, newPatch))
.then(newPatch => customers.update(id, newPatch))
.then(newPatch => customers.update(id, newPatch, null, txId))
})
.then(customer => respond(req, res, { customer }))
.catch(next)