From 6c2c8761c0cf285d626e6e63789bc9fa68dca82a Mon Sep 17 00:00:00 2001 From: Sasha Mysak Date: Mon, 20 Jan 2025 10:46:07 +0100 Subject: [PATCH] fix: remove monitoring params logic from navbar --- .../Header/hooks/useNavbarLogic/useNavbarLogic.tsx | 4 +--- .../src/pages/MerchantMonitoring/constants.ts | 1 - .../useMerchantMonitoringLogic.tsx | 7 ------- 3 files changed, 1 insertion(+), 11 deletions(-) delete mode 100644 apps/backoffice-v2/src/pages/MerchantMonitoring/constants.ts diff --git a/apps/backoffice-v2/src/common/components/organisms/Header/hooks/useNavbarLogic/useNavbarLogic.tsx b/apps/backoffice-v2/src/common/components/organisms/Header/hooks/useNavbarLogic/useNavbarLogic.tsx index be770e20cb..26f92596e7 100644 --- a/apps/backoffice-v2/src/common/components/organisms/Header/hooks/useNavbarLogic/useNavbarLogic.tsx +++ b/apps/backoffice-v2/src/common/components/organisms/Header/hooks/useNavbarLogic/useNavbarLogic.tsx @@ -6,7 +6,6 @@ import { useFilterId } from '@/common/hooks/useFilterId/useFilterId'; import { useLocale } from '@/common/hooks/useLocale/useLocale'; import { useCustomerQuery } from '@/domains/customer/hooks/queries/useCustomerQuery/useCustomerQuery'; import { useFiltersQuery } from '@/domains/filters/hooks/queries/useFiltersQuery/useFiltersQuery'; -import { MERCHANT_MONITORING_QUERY_PARAMS_KEY } from '@/pages/MerchantMonitoring/constants'; import { TRoutes, TRouteWithChildren } from '@/Router/types'; export const useNavbarLogic = () => { @@ -22,7 +21,6 @@ export const useNavbarLogic = () => { [filters], ); const { data: customer } = useCustomerQuery(); - const merchantMonitoringParams = sessionStorage.getItem(MERCHANT_MONITORING_QUERY_PARAMS_KEY); const navItems = [ { @@ -36,7 +34,7 @@ export const useNavbarLogic = () => { { text: 'Merchant Monitoring', icon: , - href: `/en/merchant-monitoring${merchantMonitoringParams ?? ''}`, + href: `/en/merchant-monitoring`, key: 'nav-item-merchant-monitoring', }, ] diff --git a/apps/backoffice-v2/src/pages/MerchantMonitoring/constants.ts b/apps/backoffice-v2/src/pages/MerchantMonitoring/constants.ts deleted file mode 100644 index d515538662..0000000000 --- a/apps/backoffice-v2/src/pages/MerchantMonitoring/constants.ts +++ /dev/null @@ -1 +0,0 @@ -export const MERCHANT_MONITORING_QUERY_PARAMS_KEY = 'merchantMonitoringParams'; diff --git a/apps/backoffice-v2/src/pages/MerchantMonitoring/hooks/useMerchantMonitoringLogic/useMerchantMonitoringLogic.tsx b/apps/backoffice-v2/src/pages/MerchantMonitoring/hooks/useMerchantMonitoringLogic/useMerchantMonitoringLogic.tsx index 0c3208a742..937a6cf9d8 100644 --- a/apps/backoffice-v2/src/pages/MerchantMonitoring/hooks/useMerchantMonitoringLogic/useMerchantMonitoringLogic.tsx +++ b/apps/backoffice-v2/src/pages/MerchantMonitoring/hooks/useMerchantMonitoringLogic/useMerchantMonitoringLogic.tsx @@ -20,8 +20,6 @@ import { RISK_LEVEL_FILTER, STATUS_LEVEL_FILTER, } from '@/pages/MerchantMonitoring/schemas'; -import { useLocation } from 'react-router-dom'; -import { MERCHANT_MONITORING_QUERY_PARAMS_KEY } from '@/pages/MerchantMonitoring/constants'; const useDefaultDateRange = () => { const [{ from, to }, setSearchParams] = useZodSearchParams(MerchantMonitoringSearchSchema); @@ -61,11 +59,6 @@ export const useMerchantMonitoringLogic = () => { setSearchParams, ] = useZodSearchParams(MerchantMonitoringSearchSchema, { replace: true }); - const { search: searchString } = useLocation(); - useEffect(() => { - sessionStorage.setItem(MERCHANT_MONITORING_QUERY_PARAMS_KEY, searchString); - }, [searchString]); - const { findings: findingsOptions, isLoading: isLoadingFindings } = useFindings(); const { data, isLoading: isLoadingBusinessReports } = useBusinessReportsQuery({