fix: send manually entered customer data to machine
This commit is contained in:
parent
c5bf50b932
commit
c2329be588
2 changed files with 11 additions and 11 deletions
|
|
@ -88,10 +88,7 @@ function update (id, data, userToken, txId) {
|
|||
' where id=$1 returning *'
|
||||
|
||||
return db.one(sql, [id])
|
||||
.then(customerData => {
|
||||
return getEditedData(id)
|
||||
.then(customerEditedData => selectLatestData(customerData, customerEditedData))
|
||||
})
|
||||
.then(assignCustomerData)
|
||||
.then(addComplianceOverrides(id, updateData, userToken))
|
||||
.then(populateOverrideUsernames)
|
||||
.then(computeStatus)
|
||||
|
|
@ -324,6 +321,7 @@ function getById (id, userToken) {
|
|||
.then(populateOverrideUsernames)
|
||||
.then(computeStatus)
|
||||
.then(populateDailyVolume)
|
||||
.then(assignCustomerData)
|
||||
.then(getCustomInfoRequestsData)
|
||||
.then(camelize)
|
||||
}
|
||||
|
|
@ -723,15 +721,18 @@ function getCustomerById (id) {
|
|||
WHERE c.id = $2
|
||||
) AS cl WHERE rn = 1`
|
||||
return db.oneOrNone(sql, [passableErrorCodes, id])
|
||||
.then(customerData => {
|
||||
return getEditedData(id)
|
||||
.then(customerEditedData => selectLatestData(customerData, customerEditedData))
|
||||
})
|
||||
.then(assignCustomerData)
|
||||
.then(populateOverrideUsernames)
|
||||
.then(camelize)
|
||||
.then(it => ({ ...it, notes: (it.notes ?? []).map(camelize) }))
|
||||
}
|
||||
|
||||
function assignCustomerData (customer) {
|
||||
return getEditedData(customer.id)
|
||||
.then(customerEditedData => selectLatestData(customer, customerEditedData))
|
||||
.then(_.assign(customer))
|
||||
}
|
||||
|
||||
/**
|
||||
* Query the specific customer manually edited data
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue