From f4e0c9a9053ebe18360c76946a751275ef984d93 Mon Sep 17 00:00:00 2001 From: andreas-unleash Date: Thu, 23 Mar 2023 16:13:28 +0200 Subject: [PATCH] fix: settings endpoint add basePath (#3377) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix missing basePath for project settings endpoint ## About the changes Closes # ### Important files ## Discussion points --------- Signed-off-by: andreas-unleash --- frontend/src/hooks/useDefaultProjectSettings.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/hooks/useDefaultProjectSettings.ts b/frontend/src/hooks/useDefaultProjectSettings.ts index ce809f4e67..0e069c5914 100644 --- a/frontend/src/hooks/useDefaultProjectSettings.ts +++ b/frontend/src/hooks/useDefaultProjectSettings.ts @@ -7,6 +7,7 @@ import { DefaultStickiness, ProjectMode, } from 'component/project/Project/hooks/useProjectForm'; +import { formatApiPath } from 'utils/formatPath'; export interface ISettingsResponse { defaultStickiness?: DefaultStickiness; @@ -19,14 +20,14 @@ export const useDefaultProjectSettings = ( ) => { const { uiConfig } = useUiConfig(); - const PATH = `/api/admin/projects/${projectId}/settings`; + const PATH = `api/admin/projects/${projectId}/settings`; const { projectScopedStickiness } = uiConfig.flags; const { data, error, mutate } = useConditionalSWR( Boolean(projectId) && Boolean(projectScopedStickiness), {}, ['useDefaultProjectSettings', PATH], - () => fetcher(PATH), + () => fetcher(formatApiPath(PATH)), options );