diff --git a/src/screens/HyperSwitch/PaymentLogs/PaymentLogs.res b/src/screens/HyperSwitch/PaymentLogs/PaymentLogs.res index 0fa198740..7019e00cb 100644 --- a/src/screens/HyperSwitch/PaymentLogs/PaymentLogs.res +++ b/src/screens/HyperSwitch/PaymentLogs/PaymentLogs.res @@ -1,5 +1,16 @@ @module("js-sha256") external sha256: string => string = "sha256" +open PaymentLogsTypes +let getLogType = dict => { + if dict->Dict.get("request_id")->Belt.Option.isSome { + PAYMENTS + } else if dict->Dict.get("component")->Belt.Option.isSome { + SDK + } else { + WEBHOOKS + } +} + module PrettyPrintJson = { open HSwitchUtils @react.component @@ -93,7 +104,6 @@ module PrettyPrintJson = { } module ApiDetailsComponent = { - open PaymentLogsTypes open LogicUtils open PaymentLogsUtils @react.component @@ -241,8 +251,8 @@ let make = (~paymentId, ~createdAt) => { open APIUtils open HSwitchUtils open LogicUtils - open PaymentLogsTypes open PaymentLogsUtils + let fetchDetails = useGetMethod(~showErrorToast=false, ()) let fetchPostDetils = useUpdateMethod() let logs = React.useMemo0(() => {ref([])}) diff --git a/src/screens/HyperSwitch/PaymentLogs/PaymentLogsUtils.res b/src/screens/HyperSwitch/PaymentLogs/PaymentLogsUtils.res index 6843b3b0f..962d57d94 100644 --- a/src/screens/HyperSwitch/PaymentLogs/PaymentLogsUtils.res +++ b/src/screens/HyperSwitch/PaymentLogs/PaymentLogsUtils.res @@ -20,17 +20,6 @@ let filteredKeys = [ "version", ] -let getLogType = dict => { - open PaymentLogsTypes - if dict->Dict.get("request_id")->Belt.Option.isSome { - PAYMENTS - } else if dict->Dict.get("component")->Belt.Option.isSome { - SDK - } else { - WEBHOOKS - } -} - let sortByCreatedAt = (log1: Js.Json.t, log2: Js.Json.t) => { open LogicUtils let getKey = dict => dict->getDictFromJsonObject->getString("created_at", "")->Js.Date.fromString