refactor: clean up some names
This commit is contained in:
parent
c2329be588
commit
31929efc5b
1 changed files with 3 additions and 4 deletions
|
|
@ -756,13 +756,12 @@ function selectLatestData (customerData, customerEditedData) {
|
||||||
'name'
|
'name'
|
||||||
]
|
]
|
||||||
_.map(field => {
|
_.map(field => {
|
||||||
let fieldName = field
|
|
||||||
if (_.includes(field, ['front_camera', 'id_card_photo'])) fieldName = fieldName + '_path'
|
|
||||||
const atField = field + '_at'
|
const atField = field + '_at'
|
||||||
const byField = field + '_by'
|
const byField = field + '_by'
|
||||||
if (!_.has(fieldName, customerData) || !_.has(fieldName, customerEditedData)) return
|
if (_.includes(field, ['front_camera', 'id_card_photo'])) field = field + '_path'
|
||||||
|
if (!_.has(field, customerData) || !_.has(field, customerEditedData)) return
|
||||||
if (customerData[atField] < customerEditedData[atField]) {
|
if (customerData[atField] < customerEditedData[atField]) {
|
||||||
customerData[fieldName] = customerEditedData[fieldName]
|
customerData[field] = customerEditedData[field]
|
||||||
customerData[atField] = customerEditedData[atField]
|
customerData[atField] = customerEditedData[atField]
|
||||||
customerData[byField] = customerEditedData[byField]
|
customerData[byField] = customerEditedData[byField]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue