diff --git a/frontend/src/hooks/api/getters/useFeatures/useFeatures.ts b/frontend/src/hooks/api/getters/useFeatures/useFeatures.ts index 056b0b94a2..3566d5d0d4 100644 --- a/frontend/src/hooks/api/getters/useFeatures/useFeatures.ts +++ b/frontend/src/hooks/api/getters/useFeatures/useFeatures.ts @@ -1,5 +1,6 @@ import { FeaturesSchema } from 'openapi'; import useSWR from 'swr'; +import { formatApiPath } from 'utils/formatPath'; import handleErrorResponses from '../httpErrorResponseHandler'; const fetcher = (path: string) => { @@ -10,7 +11,7 @@ const fetcher = (path: string) => { export const useFeatures = () => { const { data, error, mutate } = useSWR( - 'api/admin/features', + formatApiPath('api/admin/features'), fetcher, { refreshInterval: 15 * 1000, // ms diff --git a/frontend/src/hooks/api/getters/useFeaturesArchive/useFeaturesArchive.ts b/frontend/src/hooks/api/getters/useFeaturesArchive/useFeaturesArchive.ts index 6ac46a5026..0eeefbfd58 100644 --- a/frontend/src/hooks/api/getters/useFeaturesArchive/useFeaturesArchive.ts +++ b/frontend/src/hooks/api/getters/useFeaturesArchive/useFeaturesArchive.ts @@ -1,6 +1,7 @@ import useSWR from 'swr'; import { FeatureSchema, FeaturesSchema } from 'openapi'; import handleErrorResponses from '../httpErrorResponseHandler'; +import { formatApiPath } from 'utils/formatPath'; export interface IUseFeaturesArchiveOutput { archivedFeatures?: FeatureSchema[]; @@ -19,9 +20,11 @@ export const useFeaturesArchive = ( projectId?: string ): IUseFeaturesArchiveOutput => { const { data, error, mutate, isLoading } = useSWR( - projectId - ? `/api/admin/archive/features/${projectId}` - : 'api/admin/features', + formatApiPath( + projectId + ? `/api/admin/archive/features/${projectId}` + : 'api/admin/features' + ), fetcher, { refreshInterval: 15 * 1000, // ms