From f144c8a7cbd1cb2bae4afd32ed91b7699a68d03a Mon Sep 17 00:00:00 2001 From: siiky Date: Wed, 27 Mar 2024 14:14:20 +0000 Subject: [PATCH] refactor: convert function to single-expression arrow function --- lib/compliance.js | 12 +++++------- .../Customers/components/CustomInfoRequestsData.js | 5 ++--- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/compliance.js b/lib/compliance.js index 22562587..8ecd1770 100644 --- a/lib/compliance.js +++ b/lib/compliance.js @@ -72,13 +72,11 @@ function validateOfac (deviceId, sanctionsActive, customer) { function validationPatch (deviceId, sanctionsActive, customer) { return validateOfac(deviceId, sanctionsActive, customer) - .then(ofacValidation => { - if (_.isNil(customer.sanctions) || customer.sanctions !== ofacValidation) { - return {sanctions: ofacValidation} - } - - return {} - }) + .then(sactions => + _.isNil(customer.sanctions) || customer.sanctions !== sactions ? + { sanctions } : + {} + ) } module.exports = {validationPatch} diff --git a/new-lamassu-admin/src/pages/Customers/components/CustomInfoRequestsData.js b/new-lamassu-admin/src/pages/Customers/components/CustomInfoRequestsData.js index d8ca647d..635b1c78 100644 --- a/new-lamassu-admin/src/pages/Customers/components/CustomInfoRequestsData.js +++ b/new-lamassu-admin/src/pages/Customers/components/CustomInfoRequestsData.js @@ -130,13 +130,12 @@ const CustomInfoRequestsData = ({ data }) => { ) } - const getAuthorizedStatus = it => { - return it.approved === null + const getAuthorizedStatus = it => + it.approved === null ? { label: 'Pending', type: 'neutral' } : it.approved === false ? { label: 'Rejected', type: 'error' } : { label: 'Accepted', type: 'success' } - } return ( <>