refactor: convert function to single-expression arrow function

This commit is contained in:
siiky 2024-03-27 14:14:20 +00:00
parent 9ce126aee3
commit f144c8a7cb
2 changed files with 7 additions and 10 deletions

View file

@ -72,13 +72,11 @@ function validateOfac (deviceId, sanctionsActive, customer) {
function validationPatch (deviceId, sanctionsActive, customer) { function validationPatch (deviceId, sanctionsActive, customer) {
return validateOfac(deviceId, sanctionsActive, customer) return validateOfac(deviceId, sanctionsActive, customer)
.then(ofacValidation => { .then(sactions =>
if (_.isNil(customer.sanctions) || customer.sanctions !== ofacValidation) { _.isNil(customer.sanctions) || customer.sanctions !== sactions ?
return {sanctions: ofacValidation} { sanctions } :
} {}
)
return {}
})
} }
module.exports = {validationPatch} module.exports = {validationPatch}

View file

@ -130,13 +130,12 @@ const CustomInfoRequestsData = ({ data }) => {
) )
} }
const getAuthorizedStatus = it => { const getAuthorizedStatus = it =>
return it.approved === null it.approved === null
? { label: 'Pending', type: 'neutral' } ? { label: 'Pending', type: 'neutral' }
: it.approved === false : it.approved === false
? { label: 'Rejected', type: 'error' } ? { label: 'Rejected', type: 'error' }
: { label: 'Accepted', type: 'success' } : { label: 'Accepted', type: 'success' }
}
return ( return (
<> <>