From 531804779464e795d9e2f27662167d5c409226be Mon Sep 17 00:00:00 2001 From: Syed Ali Shahbaz <52925846+alishaz-polymath@users.noreply.github.com> Date: Wed, 29 Sep 2021 22:34:47 +0530 Subject: [PATCH] fixed reload after disband team (#823) --- components/team/TeamList.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/team/TeamList.tsx b/components/team/TeamList.tsx index 7481a40287..6a6ae7877e 100644 --- a/components/team/TeamList.tsx +++ b/components/team/TeamList.tsx @@ -18,10 +18,11 @@ export default function TeamList(props: { } }; - const deleteTeam = (team: Team) => { - return fetch("/api/teams/" + team.id, { + const deleteTeam = async (team: Team) => { + await fetch("/api/teams/" + team.id, { method: "DELETE", - }).then(props.onChange()); + }); + return props.onChange(); }; return (