Skip to content

Commit

Permalink
refactor: unused routing Types and utils
Browse files Browse the repository at this point in the history
  • Loading branch information
jainlokesh318 committed Jan 15, 2024
1 parent 6786412 commit f77b4f8
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
8 changes: 0 additions & 8 deletions src/screens/HyperSwitch/Routing/RoutingUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,6 @@ let constructNameDescription = routingType => {

let currentTabNameRecoilAtom = Recoil.atom(. "currentTabName", "ActiveTab")

let validateNameAndDescription = (~dict, ~errors) => {
["name", "description"]->Array.forEach(field => {
if dict->LogicUtils.getString(field, "")->String.trim === "" {
errors->Dict.set(field, `Please provide ${field} field`->Js.Json.string)
}
})
}

let checkIfValuePresent = dict => {
let valueFromObject = dict->getDictfromDict("value")

Expand Down
1 change: 0 additions & 1 deletion src/screens/HyperSwitch/Routing/VolumeSplitRouting.res
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
open APIUtils
open RoutingTypes
open RoutingPreviewer

open LogicUtils

module VolumeRoutingView = {
Expand Down
2 changes: 1 addition & 1 deletion src/screens/HyperSwitch/RoutingRevamp/AdvancedRouting.res
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ let make = (~routingRuleId, ~isActive, ~setCurrentRouting) => {

let errors = Dict.make()

RoutingUtils.validateNameAndDescription(~dict, ~errors)
AdvancedRoutingUtils.validateNameAndDescription(~dict, ~errors)

let validateGateways = (connectorData: array<AdvancedRoutingTypes.connectorSelectionData>) => {
if connectorData->Array.length === 0 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,3 +400,11 @@ let initialValues: AdvancedRoutingTypes.advancedRouting = {
\"type": "",
},
}

let validateNameAndDescription = (~dict, ~errors) => {
["name", "description"]->Array.forEach(field => {
if dict->LogicUtils.getString(field, "")->String.trim === "" {
errors->Dict.set(field, `Please provide ${field} field`->Js.Json.string)
}
})
}
2 changes: 1 addition & 1 deletion src/screens/HyperSwitch/Surcharge/Surcharge.res
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ let make = () => {

let errors = Dict.make()

RoutingUtils.validateNameAndDescription(~dict, ~errors)
AdvancedRoutingUtils.validateNameAndDescription(~dict, ~errors)

switch dict->Dict.get("algorithm")->Belt.Option.flatMap(Js.Json.decodeObject) {
| Some(jsonDict) => {
Expand Down
2 changes: 1 addition & 1 deletion src/screens/HyperSwitch/ThreeDSFlow/HSwitchThreeDS.res
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ let make = () => {

let errors = Dict.make()

RoutingUtils.validateNameAndDescription(~dict, ~errors)
AdvancedRoutingUtils.validateNameAndDescription(~dict, ~errors)

switch dict->Dict.get("algorithm")->Belt.Option.flatMap(Js.Json.decodeObject) {
| Some(jsonDict) => {
Expand Down

0 comments on commit f77b4f8

Please sign in to comment.