Skip to content

Commit

Permalink
fix: missing formatApiPath
Browse files Browse the repository at this point in the history
  • Loading branch information
Gastón Fournier committed Jan 27, 2023
1 parent 20fac52 commit 035464a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion 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) => {
Expand All @@ -10,7 +11,7 @@ const fetcher = (path: string) => {

export const useFeatures = () => {
const { data, error, mutate } = useSWR<FeaturesSchema>(
'api/admin/features',
formatApiPath('api/admin/features'),
fetcher,
{
refreshInterval: 15 * 1000, // ms
Expand Down
@@ -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[];
Expand All @@ -19,9 +20,11 @@ export const useFeaturesArchive = (
projectId?: string
): IUseFeaturesArchiveOutput => {
const { data, error, mutate, isLoading } = useSWR<FeaturesSchema>(
projectId
? `/api/admin/archive/features/${projectId}`
: 'api/admin/features',
formatApiPath(
projectId
? `/api/admin/archive/features/${projectId}`
: 'api/admin/features'
),
fetcher,
{
refreshInterval: 15 * 1000, // ms
Expand Down

0 comments on commit 035464a

Please sign in to comment.