Skip to content

Commit

Permalink
fix: Update status of connector ( Disable / Enable ) (#1575)
Browse files Browse the repository at this point in the history
  • Loading branch information
kanikabansal-juspay authored Oct 8, 2024
1 parent 470b582 commit b5c14dd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/screens/Connectors/ConnectorPreview.res
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ let make = (
let updateDetails = useUpdateMethod()
let showToast = ToastState.useShowToast()
let mixpanelEvent = MixpanelHook.useSendEvent()
let fetchConnectorListResponse = ConnectorListHook.useFetchConnectorList()
let connector = UrlUtils.useGetFilterDictFromUrl("")->LogicUtils.getString("name", "")
let {setShowFeedbackModal} = React.useContext(GlobalProvider.defaultContext)
let (screenState, setScreenState) = React.useState(_ => PageLoaderWrapper.Success)
Expand Down Expand Up @@ -346,9 +347,10 @@ let make = (
isConnectorDisabled,
)
let url = getURL(~entityName=CONNECTOR, ~methodType=Post, ~id=Some(connectorID))
let _ = await updateDetails(url, disableConnectorPayload->JSON.Encode.object, Post)
let res = await updateDetails(url, disableConnectorPayload->JSON.Encode.object, Post)
fetchConnectorListResponse()->ignore
setInitialValues(_ => res)
showToast(~message=`Successfully Saved the Changes`, ~toastType=ToastSuccess)
RescriptReactRouter.push(GlobalVars.appendDashboardPath(~url=redirectPath))
} catch {
| Exn.Error(_) => showToast(~message=`Failed to Disable connector!`, ~toastType=ToastError)
}
Expand Down

0 comments on commit b5c14dd

Please sign in to comment.