Skip to content

Commit

Permalink
refcator:changed code to work with new connector_type field in Connec…
Browse files Browse the repository at this point in the history
…torType.res
  • Loading branch information
Mudit Bhatia authored and Mudit Bhatia committed Jan 20, 2025
1 parent af095af commit f2352c6
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 19 deletions.
8 changes: 2 additions & 6 deletions src/screens/Connectors/FraudAndRisk/FRMSelect.res
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions src/screens/Connectors/TaxProcessor/TaxProcessorList.res
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down

0 comments on commit f2352c6

Please sign in to comment.