diff --git a/components/GameModManagementModal.tsx b/components/GameModManagementModal.tsx index 519082e..7092696 100644 --- a/components/GameModManagementModal.tsx +++ b/components/GameModManagementModal.tsx @@ -45,8 +45,8 @@ export default function (props: { isOpen: boolean; onClose: () => void }) { })(); }, [props.isOpen]); - async function addUser(user: string) { - if (!user || !user.match(/^\d{17,19}$/)) { + async function addUser() { + if (!userToAdd || !userToAdd.match(/^\d{17,19}$/)) { toast({ description: "Please check your input and try again", status: "error", @@ -57,7 +57,7 @@ export default function (props: { isOpen: boolean; onClose: () => void }) { } const addResp = await fetch("/api/gme/add", { - body: JSON.stringify({ user }), + body: JSON.stringify({ user: userToAdd }), headers: { "content-type": "application/json", }, @@ -75,7 +75,7 @@ export default function (props: { isOpen: boolean; onClose: () => void }) { } toast({ - description: `User ${user} added`, + description: `User ${userToAdd} added`, status: "success", title: "Success", }); @@ -148,7 +148,7 @@ export default function (props: { isOpen: boolean; onClose: () => void }) { onChange={(e) => setUserToAdd(e.target.value)} placeholder="1234567890987654321" /> - +