mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
fix: missing formatApiPath (#3006)
## About the changes Archive page is not loading archived feature toggles. When fetching from the server is not including the baseUrl
This commit is contained in:
parent
816c8dbb46
commit
d821b1ead1
@ -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<FeaturesSchema>(
|
||||
'api/admin/features',
|
||||
formatApiPath('api/admin/features'),
|
||||
fetcher,
|
||||
{
|
||||
refreshInterval: 15 * 1000, // ms
|
||||
|
@ -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<FeaturesSchema>(
|
||||
formatApiPath(
|
||||
projectId
|
||||
? `/api/admin/archive/features/${projectId}`
|
||||
: 'api/admin/features',
|
||||
: 'api/admin/features'
|
||||
),
|
||||
fetcher,
|
||||
{
|
||||
refreshInterval: 15 * 1000, // ms
|
||||
|
Loading…
Reference in New Issue
Block a user