From 6c627a6992e2e229bcb3fd7ed19fe38d97db7f28 Mon Sep 17 00:00:00 2001 From: Simon ZHANG <102216594+userMeh@users.noreply.github.com> Date: Sun, 21 Jul 2024 18:50:13 +0200 Subject: [PATCH] fix: reload page after fetching data (#285) --- apps/admin/app/ui/dashboard/tournaments/matches/AddMatch.tsx | 5 ++--- apps/admin/app/ui/dashboard/tournaments/matches/AddRound.tsx | 5 ++--- .../admin/app/ui/dashboard/tournaments/matches/EditMatch.tsx | 5 ++--- .../admin/app/ui/dashboard/tournaments/matches/EditRound.tsx | 5 ++--- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/apps/admin/app/ui/dashboard/tournaments/matches/AddMatch.tsx b/apps/admin/app/ui/dashboard/tournaments/matches/AddMatch.tsx index ba75aeae..71c0106d 100644 --- a/apps/admin/app/ui/dashboard/tournaments/matches/AddMatch.tsx +++ b/apps/admin/app/ui/dashboard/tournaments/matches/AddMatch.tsx @@ -98,13 +98,12 @@ function AddMatch(props: AddMatchProps) { router.push('/'); return; } + const url = `/dashboard/tournaments/matches?id_tournament=${props.idTournament}&created=true`; + window.location.href = url; }) .catch((error) => { console.error(error); }); - - const url = `/dashboard/tournaments/matches?id_tournament=${props.idTournament}&created=true`; - window.location.href = url; } return ( diff --git a/apps/admin/app/ui/dashboard/tournaments/matches/AddRound.tsx b/apps/admin/app/ui/dashboard/tournaments/matches/AddRound.tsx index 56bf85a7..e2cb7403 100644 --- a/apps/admin/app/ui/dashboard/tournaments/matches/AddRound.tsx +++ b/apps/admin/app/ui/dashboard/tournaments/matches/AddRound.tsx @@ -55,13 +55,12 @@ function AddRound(props: AddRoundProps) { router.push('/'); return; } + const url = `/dashboard/tournaments/matches?id_tournament=${props.id_tournament}&created=true`; + window.location.href = url; }) .catch((error) => { console.error(error); }); - - const url = `/dashboard/tournaments/matches?id_tournament=${props.id_tournament}&created=true`; - window.location.href = url; } return ( diff --git a/apps/admin/app/ui/dashboard/tournaments/matches/EditMatch.tsx b/apps/admin/app/ui/dashboard/tournaments/matches/EditMatch.tsx index f50ec262..f4c90252 100644 --- a/apps/admin/app/ui/dashboard/tournaments/matches/EditMatch.tsx +++ b/apps/admin/app/ui/dashboard/tournaments/matches/EditMatch.tsx @@ -120,13 +120,12 @@ function EditMatch(props: EditMatchProps) { router.push('/'); return; } + const url = `/dashboard/tournaments/matches?id_tournament=${props.idTournament}&updated=true`; + window.location.href = url; }) .catch((error) => { console.error(error); }); - - const url = `/dashboard/tournaments/matches?id_tournament=${props.idTournament}&updated=true`; - window.location.href = url; } return ( diff --git a/apps/admin/app/ui/dashboard/tournaments/matches/EditRound.tsx b/apps/admin/app/ui/dashboard/tournaments/matches/EditRound.tsx index c9664854..f3a480bc 100644 --- a/apps/admin/app/ui/dashboard/tournaments/matches/EditRound.tsx +++ b/apps/admin/app/ui/dashboard/tournaments/matches/EditRound.tsx @@ -60,13 +60,12 @@ function EditRound(props: EditRoundProps) { router.push('/'); return; } + const url = `/dashboard/tournaments/matches?id_tournament=${props.round.id_tournament}&updated=true`; + window.location.href = url; }) .catch((error) => { console.error(error); }); - - const url = `/dashboard/tournaments/matches?id_tournament=${props.round.id_tournament}&updated=true`; - window.location.href = url; } return (