From f2352c6f11eca0c2d6635ae6f4de8b9fe8d8d361 Mon Sep 17 00:00:00 2001 From: Mudit Bhatia Date: Mon, 20 Jan 2025 11:58:12 +0530 Subject: [PATCH] refcator:changed code to work with new connector_type field in ConnectorType.res --- src/screens/Connectors/FraudAndRisk/FRMSelect.res | 8 ++------ .../PMAuthenticationConnectorList.res | 4 +--- .../Connectors/PayoutProcessor/PayoutProcessorList.res | 4 +--- src/screens/Connectors/TaxProcessor/TaxProcessorList.res | 4 +--- .../Connectors/ThreeDsProcessors/ThreeDsConnectorList.res | 5 +---- 5 files changed, 6 insertions(+), 19 deletions(-) diff --git a/src/screens/Connectors/FraudAndRisk/FRMSelect.res b/src/screens/Connectors/FraudAndRisk/FRMSelect.res index 33ca7ccfb..25734830d 100644 --- a/src/screens/Connectors/FraudAndRisk/FRMSelect.res +++ b/src/screens/Connectors/FraudAndRisk/FRMSelect.res @@ -103,16 +103,12 @@ let make = () => { let getConnectorList = async _ => { try { let processorsList = - connectorList->Array.filter(item => - item.connector_type->ConnectorUtils.connectorTypeStringToTypeMapper === PaymentProcessor - ) + connectorList->Array.filter(item => item.connector_type === PaymentProcessor) let connectorsCount = processorsList->Array.length if connectorsCount > 0 { let frmConnectorList = - connectorList->Array.filter(item => - item.connector_type->ConnectorUtils.connectorTypeStringToTypeMapper === PaymentVas - ) + connectorList->Array.filter(item => item.connector_type === PaymentVas) setConfiguredFRMs(_ => frmConnectorList) setFilteredFRMData(_ => frmConnectorList->Array.map(Nullable.make)) setScreenState(_ => Success) diff --git a/src/screens/Connectors/PMAuthenticationProcessor/PMAuthenticationConnectorList.res b/src/screens/Connectors/PMAuthenticationProcessor/PMAuthenticationConnectorList.res index 92d0f018e..05d0a2506 100644 --- a/src/screens/Connectors/PMAuthenticationProcessor/PMAuthenticationConnectorList.res +++ b/src/screens/Connectors/PMAuthenticationProcessor/PMAuthenticationConnectorList.res @@ -30,9 +30,7 @@ let make = () => { let getConnectorList = async _ => { try { let pmAuthConnectorsList = - connectorList->Array.filter(item => - item.connector_type->ConnectorUtils.connectorTypeStringToTypeMapper === PMAuthProcessor - ) + connectorList->Array.filter(item => item.connector_type === PMAuthProcessor) ConnectorUtils.sortByDisableField(pmAuthConnectorsList, connectorPayload => connectorPayload.disabled ) diff --git a/src/screens/Connectors/PayoutProcessor/PayoutProcessorList.res b/src/screens/Connectors/PayoutProcessor/PayoutProcessorList.res index e46fb34b3..0c79de2a0 100644 --- a/src/screens/Connectors/PayoutProcessor/PayoutProcessorList.res +++ b/src/screens/Connectors/PayoutProcessor/PayoutProcessorList.res @@ -15,9 +15,7 @@ let make = () => { let getConnectorListAndUpdateState = async () => { try { let payoutConnectorsList = - connectorList->Array.filter(item => - item.connector_type->ConnectorUtils.connectorTypeStringToTypeMapper === PayoutProcessor - ) + connectorList->Array.filter(item => item.connector_type === PayoutProcessor) payoutConnectorsList->Array.reverse ConnectorUtils.sortByDisableField(payoutConnectorsList, connectorPayload => connectorPayload.disabled diff --git a/src/screens/Connectors/TaxProcessor/TaxProcessorList.res b/src/screens/Connectors/TaxProcessor/TaxProcessorList.res index 47a1a8735..9959aabbd 100644 --- a/src/screens/Connectors/TaxProcessor/TaxProcessorList.res +++ b/src/screens/Connectors/TaxProcessor/TaxProcessorList.res @@ -30,9 +30,7 @@ let make = () => { let getConnectorList = async _ => { try { let taxConnectorsList = - connectorList->Array.filter(item => - item.connector_type->ConnectorUtils.connectorTypeStringToTypeMapper === TaxProcessor - ) + connectorList->Array.filter(item => item.connector_type === TaxProcessor) ConnectorUtils.sortByDisableField(taxConnectorsList, connectorPayload => connectorPayload.disabled ) diff --git a/src/screens/Connectors/ThreeDsProcessors/ThreeDsConnectorList.res b/src/screens/Connectors/ThreeDsProcessors/ThreeDsConnectorList.res index c3ef02af2..7db75bf11 100644 --- a/src/screens/Connectors/ThreeDsProcessors/ThreeDsConnectorList.res +++ b/src/screens/Connectors/ThreeDsProcessors/ThreeDsConnectorList.res @@ -31,10 +31,7 @@ let make = () => { let getConnectorList = async _ => { try { let threeDsConnectorsList = - connectorList->Array.filter(item => - item.connector_type->ConnectorUtils.connectorTypeStringToTypeMapper === - AuthenticationProcessor - ) + connectorList->Array.filter(item => item.connector_type === AuthenticationProcessor) ConnectorUtils.sortByDisableField(threeDsConnectorsList, connectorPayload => connectorPayload.disabled )