Skip to content

Commit

Permalink
disabled bracket change
Browse files Browse the repository at this point in the history
  • Loading branch information
nkurelli committed Jan 28, 2024
1 parent fb66fcf commit 78b3e3a
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions src/pages/team/[teamname].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,26 +169,28 @@ const Team: NextPage = ({

const changeBracket = async (team: string | null | undefined) => {
if (!team) return;
const newBracket = document.getElementById(
'newbracket',
) as HTMLInputElement;
const newBracketValue = newBracket.value;

await axios
.post('/api/team/bracket-change', {
team,
bracket: newBracketValue,
})
.then((res) => {
if (res.status === 200) {
toast.dismiss();
toast.success('Bracket changed successfully!', { autoClose: 2000 });
setTimeout(refreshData, 500);
}
})
.catch(() => {
toast.error('Bracket change not successful!');
});
toast.error('Bracket changes are currently disabled!');
// return;
// const newBracket = document.getElementById(
// 'newbracket',
// ) as HTMLInputElement;
// const newBracketValue = newBracket.value;

// await axios
// .post('/api/team/bracket-change', {
// team,
// bracket: newBracketValue,
// })
// .then((res) => {
// if (res.status === 200) {
// toast.dismiss();
// toast.success('Bracket changed successfully!', { autoClose: 2000 });
// setTimeout(refreshData, 500);
// }
// })
// .catch(() => {
// toast.error('Bracket change not successful!');
// });
};

const handleChangeBracket = async (e: any) => {
Expand Down

0 comments on commit 78b3e3a

Please sign in to comment.