From 678641235361abbf9259731ac68fe65b8a8d26c6 Mon Sep 17 00:00:00 2001 From: Lokesh Jain Date: Mon, 15 Jan 2024 16:51:13 +0530 Subject: [PATCH] refactor: unused routing Types and utils --- .../HyperSwitch/Routing/RoutingUtils.res | 38 ------------------- .../Routing/VolumeSplitRouting.res | 4 +- .../RoutingRevamp/AdvancedRouting.res | 2 +- .../RoutingRevamp/AdvancedRoutingUIUtils.res | 38 +++++++++++++++++++ 4 files changed, 42 insertions(+), 40 deletions(-) diff --git a/src/screens/HyperSwitch/Routing/RoutingUtils.res b/src/screens/HyperSwitch/Routing/RoutingUtils.res index e8a8d03af..b50f3fbad 100644 --- a/src/screens/HyperSwitch/Routing/RoutingUtils.res +++ b/src/screens/HyperSwitch/Routing/RoutingUtils.res @@ -170,44 +170,6 @@ let constructNameDescription = routingType => { let currentTabNameRecoilAtom = Recoil.atom(. "currentTabName", "ActiveTab") -module SaveAndActivateButton = { - @react.component - let make = ( - ~onSubmit: (Js.Json.t, 'a) => promise>, - ~handleActivateConfiguration, - ) => { - let formState: ReactFinalForm.formState = ReactFinalForm.useFormState( - ReactFinalForm.useFormSubscription(["values"])->Js.Nullable.return, - ) - - let handleSaveAndActivate = async _ev => { - try { - let onSubmitResponse = await onSubmit(formState.values, false) - let currentActivatedFromJson = - onSubmitResponse->Js.Nullable.toOption->Belt.Option.getWithDefault(Js.Json.null) - let currentActivatedId = - currentActivatedFromJson->LogicUtils.getDictFromJsonObject->LogicUtils.getString("id", "") - let _ = await handleActivateConfiguration(Some(currentActivatedId)) - } catch { - | Js.Exn.Error(e) => - let _err = - Js.Exn.message(e)->Belt.Option.getWithDefault( - "Failed to save and activate configuration!", - ) - } - } -