Skip to content

Commit

Permalink
update join party code handling
Browse files Browse the repository at this point in the history
  • Loading branch information
minhd-vu committed Feb 25, 2024
1 parent 054c609 commit 329e98b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions components/JoinParty.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ export default function JoinParty() {
event.preventDefault();

const data = new FormData(event.currentTarget);
let code = data.get("code");
if (code) {
code = code.toString().toLowerCase();
const value = data.get("code");
if (!value) {
throw new Error();
}

const code = value.toString().toLowerCase();
const res = await fetch("/api/party/join", {
method: "POST",
headers: {
Expand Down

0 comments on commit 329e98b

Please sign in to comment.