Fix: remove double basePath prefix in deploy widget SWR key
SWR middleware already prepends NEXT_PUBLIC_BASE_PATH; statusUrl
must start with /deploy-api/... not /${bp}/deploy-api/...
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
81fb160eb5
commit
8874bc604c
1 changed files with 2 additions and 1 deletions
|
|
@ -24,7 +24,8 @@ function formatTime(iso) {
|
|||
export default function Deploy({ options }) {
|
||||
const { service, label, apiBase = "/deploy-api" } = options ?? {};
|
||||
const bp = process.env.NEXT_PUBLIC_BASE_PATH ?? "";
|
||||
const statusUrl = service ? `${bp}${apiBase}/status/${service}` : null;
|
||||
// SWR middleware already prepends bp, so statusUrl must NOT include it
|
||||
const statusUrl = service ? `${apiBase}/status/${service}` : null;
|
||||
|
||||
const { data, mutate } = useSWR(statusUrl, {
|
||||
refreshInterval: (d) => (d?.status === "running" ? 2000 : 10000),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue