Skip to content

Commit

Permalink
update getBoothName API
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent550102 committed Feb 27, 2024
1 parent abf7d15 commit 1179b59
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/app/(booth)/booth/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 : "(攤位不存在)");
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/lib/getBoothName.ts
Original file line number Diff line number Diff line change
@@ -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;
});
}

0 comments on commit 1179b59

Please sign in to comment.