Skip to content

Commit 86b18dc

Browse files
authored
Merge pull request #113 from Team-Senifit/release-1.0.1
fix: force /api prefix for client queries
2 parents c81b8a0 + 760f0cb commit 86b18dc

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/app/panel/QueryClientProvider.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,18 @@ async function axiosQueryFn({
5454
// 예: https://localhost:3000 + /api + /health
5555
endpoint = `${siteUrl}${apiBase}${path}`;
5656
} else {
57-
// 3. 클라이언트일 때는 axiosClient의 baseURL(/api)이 있으므로 path만 전달
58-
endpoint = path;
57+
// 3. 클라이언트에서도 /api 프리픽스를 명시해 프록시를 강제
58+
const base = apiBase.startsWith("/") ? apiBase : `/${apiBase}`;
59+
endpoint = `${base}${path}`;
5960
}
6061
}
6162

62-
const res = await axiosClient.get(endpoint, { params, signal });
63+
const res = await axiosClient.get(endpoint, {
64+
params,
65+
signal,
66+
// endpoint에 /api를 포함했으므로 baseURL을 비활성화
67+
baseURL: "",
68+
});
6369
return res.data;
6470
}
6571

0 commit comments

Comments
 (0)