Skip to content

Commit

Permalink
fixing axios
Browse files Browse the repository at this point in the history
  • Loading branch information
Saurabhchaddha6 committed Aug 13, 2024
1 parent 7bec6ea commit e23107d
Show file tree
Hide file tree
Showing 3 changed files with 1,359 additions and 1,284 deletions.
17 changes: 10 additions & 7 deletions app/tournaments/[id]/register/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ export default function RegisterPage() {
const handleSubmit = async (e) => {
e.preventDefault();
setIsLoading(true);

const formData = {
teamName,
members,
email,
selectedPlatform,
participantType,
};

try {
const response = await axios.post(`/api/register/${tournamentId}`, {
teamName,
members,
email,
selectedPlatform,
participantType
});
const response = await axios.post(`/api/register/${tournamentId}`, formData);

if (response.status === 201) {
alert('Registration successful!');
Expand Down
Loading

0 comments on commit e23107d

Please sign in to comment.