diff --git a/src/v6y-front-bo/src/infrastructure/adapters/navigation/useNavigationAdapter.tsx b/src/v6y-front-bo/src/infrastructure/adapters/navigation/useNavigationAdapter.tsx index 25ce976..a01a303 100644 --- a/src/v6y-front-bo/src/infrastructure/adapters/navigation/useNavigationAdapter.tsx +++ b/src/v6y-front-bo/src/infrastructure/adapters/navigation/useNavigationAdapter.tsx @@ -8,7 +8,7 @@ const useNavigationAdapter = () => { const pathname = usePathname(); const router = useRouter(); - const creatUrlQueryParam = useCallback( + const createUrlQueryParam = useCallback( (name: string, value: string) => { const params = new URLSearchParams(searchParams.toString()); params.set(name, value); @@ -30,7 +30,7 @@ const useNavigationAdapter = () => { router, redirect, getUrlParams: (paramKeys: string[]) => paramKeys?.map((key) => searchParams.get(key)), - creatUrlQueryParam, + createUrlQueryParam, removeUrlQueryParam, urlParams: searchParams?.toString(), pathname, diff --git a/src/v6y-front/src/commons/components/VitalitySearchBar.tsx b/src/v6y-front/src/commons/components/VitalitySearchBar.tsx index 464be22..1812996 100644 --- a/src/v6y-front/src/commons/components/VitalitySearchBar.tsx +++ b/src/v6y-front/src/commons/components/VitalitySearchBar.tsx @@ -10,19 +10,19 @@ import { VitalitySearchBarProps } from '../types/VitalitySearchBarProps'; const { Search } = Input; const VitalitySearchBar = ({ helper, label, status, placeholder }: VitalitySearchBarProps) => { - const { router, pathname, getUrlParams, creatUrlQueryParam, removeUrlQueryParam } = + const { router, pathname, getUrlParams, createUrlQueryParam, removeUrlQueryParam } = useNavigationAdapter(); const [searchText] = getUrlParams(['searchText']); const handleOnSearchChanged = (value: string) => { if (pathname === VitalityNavigationPaths.DASHBOARD) { - const queryParams = creatUrlQueryParam('searchText', value); + const queryParams = createUrlQueryParam('searchText', value); router.push(`/search?${queryParams}`); return; } if (value?.length) { - const queryParams = creatUrlQueryParam('searchText', value); + const queryParams = createUrlQueryParam('searchText', value); router.replace(`${pathname}?${queryParams}`); } else { const queryParams = removeUrlQueryParam('searchText'); diff --git a/src/v6y-front/src/commons/components/__tests__/VitalityAppInfos-test.tsx b/src/v6y-front/src/commons/components/__tests__/VitalityAppInfos-test.tsx index 87c311e..fac3cd9 100644 --- a/src/v6y-front/src/commons/components/__tests__/VitalityAppInfos-test.tsx +++ b/src/v6y-front/src/commons/components/__tests__/VitalityAppInfos-test.tsx @@ -29,7 +29,7 @@ describe('VitalityAppInfos', () => { beforeEach(() => { useNavigationAdapter.mockReturnValue({ - creatUrlQueryParam: vi.fn((key, value) => `${key}=${value}`), + createUrlQueryParam: vi.fn((key, value) => `${key}=${value}`), }); }); diff --git a/src/v6y-front/src/commons/components/application-info/VitalityAppInfos.tsx b/src/v6y-front/src/commons/components/application-info/VitalityAppInfos.tsx index 1dfe41d..e8e822e 100644 --- a/src/v6y-front/src/commons/components/application-info/VitalityAppInfos.tsx +++ b/src/v6y-front/src/commons/components/application-info/VitalityAppInfos.tsx @@ -10,8 +10,8 @@ import { VitalityAppInfosProps } from '../../types/VitalityAppInfosProps'; import VitalityLinks from '../VitalityLinks'; const VitalityAppInfos = ({ app, source, canOpenDetails = true, style }: VitalityAppInfosProps) => { - const { creatUrlQueryParam } = useNavigationAdapter(); - const queryParams = creatUrlQueryParam('_id', `${app._id}`); + const { createUrlQueryParam } = useNavigationAdapter(); + const queryParams = createUrlQueryParam('_id', `${app._id}`); const appDetailsLink = source ? VitalityNavigationPaths.APP_DETAILS + '?' + queryParams + '&' + 'source=' + source : VitalityNavigationPaths.APP_DETAILS + '?' + queryParams; diff --git a/src/v6y-front/src/commons/components/indicators/VitalitySelectableIndicators.tsx b/src/v6y-front/src/commons/components/indicators/VitalitySelectableIndicators.tsx index 6a7c27f..f201488 100644 --- a/src/v6y-front/src/commons/components/indicators/VitalitySelectableIndicators.tsx +++ b/src/v6y-front/src/commons/components/indicators/VitalitySelectableIndicators.tsx @@ -23,7 +23,7 @@ const VitalitySelectableIndicators = () => { const [selectedIndicators, setSelectedIndicators] = useState(); const [indicatorsList, setIndicatorsList] = useState(); - const { router, pathname, getUrlParams, creatUrlQueryParam, removeUrlQueryParam } = + const { router, pathname, getUrlParams, createUrlQueryParam, removeUrlQueryParam } = useNavigationAdapter(); const [keywordsUrlParams] = getUrlParams(['keywords']); @@ -62,7 +62,7 @@ const VitalitySelectableIndicators = () => { const handleSelectedIndicator = (values: string[]) => { if (values?.length) { - const queryParams = creatUrlQueryParam('keywords', values?.join(',')); + const queryParams = createUrlQueryParam('keywords', values?.join(',')); router.replace(`${pathname}?${queryParams}`); } else { const queryParams = removeUrlQueryParam('keywords'); diff --git a/src/v6y-front/src/infrastructure/adapters/navigation/useNavigationAdapter.tsx b/src/v6y-front/src/infrastructure/adapters/navigation/useNavigationAdapter.tsx index 25ce976..a01a303 100644 --- a/src/v6y-front/src/infrastructure/adapters/navigation/useNavigationAdapter.tsx +++ b/src/v6y-front/src/infrastructure/adapters/navigation/useNavigationAdapter.tsx @@ -8,7 +8,7 @@ const useNavigationAdapter = () => { const pathname = usePathname(); const router = useRouter(); - const creatUrlQueryParam = useCallback( + const createUrlQueryParam = useCallback( (name: string, value: string) => { const params = new URLSearchParams(searchParams.toString()); params.set(name, value); @@ -30,7 +30,7 @@ const useNavigationAdapter = () => { router, redirect, getUrlParams: (paramKeys: string[]) => paramKeys?.map((key) => searchParams.get(key)), - creatUrlQueryParam, + createUrlQueryParam, removeUrlQueryParam, urlParams: searchParams?.toString(), pathname,