diff --git a/src/frontend.tsx b/src/frontend.tsx index e8ba087..90fe487 100644 --- a/src/frontend.tsx +++ b/src/frontend.tsx @@ -48,7 +48,11 @@ const route = createBrowserRouter([ score: e.score, realname: e.name, } as XCXMember)); - const uidScore = await fetch(`/api/user/nowScores?uids=${info.players.map(e => e.uid).join(',')}`); + const uids = info.players.map(e => e.uid); + const uidScore = await fetch(`/api/user/nowScores`, { + method: "POST", + body: JSON.stringify({ uids }), + }); return { info, members, uidScore: new Map(Object.entries(await uidScore.json())) }; }, Component: EventPage, diff --git a/src/index.tsx b/src/index.tsx index 5b04488..59af538 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -43,9 +43,8 @@ const server = serve({ } }, "/api/user/nowScores": { - async GET(req) { - const searchParams = new URL(req.url).searchParams; - const uids = searchParams.get('uids')?.split(',') ?? []; + async POST(req) { + const { uids } = await req.json(); const uidScore = await getUidScore(uids); return Response.json(uidScore); }