diff --git a/leaky-ships/pages/dev/index.tsx b/leaky-ships/pages/dev/index.tsx index 49388c7..e0aec1a 100644 --- a/leaky-ships/pages/dev/index.tsx +++ b/leaky-ships/pages/dev/index.tsx @@ -48,15 +48,14 @@ export default function Home({ q }: Props) { }) .optional(), }) - const gamePromise = getAccessToken().then((token) => { - console.log(otp, { ...token, pin }) - return fetch("/api/game/" + (!pin ? "create" : "join"), { + const gamePromise = getAccessToken().then((token) => + fetch("/api/game/" + (!pin ? "create" : "join"), { method: "POST", - body: JSON.stringify({ ...token, pin: pin }), + body: JSON.stringify({ token, pin }), }) .then(successfulResponse) .then((game) => createSchema.parse(game)) - }) + ) const res = await toast.promise(gamePromise, { pending: { @@ -103,7 +102,7 @@ export default function Home({ q }: Props) { return } gameFetch(otp) - }, [otp]) + }, [otp, gameFetch]) return (