diff --git a/src/app/(booth)/booth/page.tsx b/src/app/(booth)/booth/page.tsx index 0e30b1d..179a8b4 100644 --- a/src/app/(booth)/booth/page.tsx +++ b/src/app/(booth)/booth/page.tsx @@ -21,7 +21,7 @@ export default function Page() { boothToken, ); if (boothName === null) { - const boothName = await getBoothName(boothToken); + const boothName = (await getBoothName(boothToken))?.slug; setBoothName(boothName ? boothName : "(攤位不存在)"); } } diff --git a/src/lib/getBoothName.ts b/src/lib/getBoothName.ts index 1a6a687..ee55b27 100644 --- a/src/lib/getBoothName.ts +++ b/src/lib/getBoothName.ts @@ -1,8 +1,8 @@ -import { MAPPING_URL } from "./const"; +import { API_URL } from "./const"; export async function getBoothName(token: string) { - return fetch(`${MAPPING_URL}?token=${token}`) + return fetch(`${API_URL}/event/puzzle/deliverer?token=${token}`) .then((res) => { - return res.status === 200 ? res.text() : null; + return res.status === 200 ? res.json() : null; }); }