bug fixes
This commit is contained in:
@@ -5,6 +5,7 @@ import { useRef, useState } from "react";
|
||||
|
||||
export default function Home() {
|
||||
const nameInputRef = useRef<HTMLInputElement>(null);
|
||||
const currentPlayers = useState<string | null>(null);
|
||||
|
||||
const addPlayer = async () => {
|
||||
const playerName = nameInputRef.current?.value?.trim();
|
||||
@@ -14,7 +15,8 @@ const addPlayer = async () => {
|
||||
}
|
||||
|
||||
try {
|
||||
const res = await fetch('http://localhost:8080/add', {
|
||||
console.log(`${process.env.NEXT_PUBLIC_API_BASE}`);
|
||||
const res = await fetch(`${process.env.NEXT_PUBLIC_API_BASE}/add`, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ name: playerName, group: selectedGroup }),
|
||||
@@ -43,6 +45,8 @@ const addPlayer = async () => {
|
||||
|
||||
return (
|
||||
<div className="grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20 font-[family-name:var(--font-geist-sans)]">
|
||||
Game Info
|
||||
|
||||
<main className="flex flex-col gap-[32px] row-start-2 items-center sm:items-start">
|
||||
<div className="flex gap-8 mb-4">
|
||||
<label className="flex items-center gap-2 cursor-pointer">
|
||||
|
||||
Reference in New Issue
Block a user