From b94d908339ca50e879b057abbb28df4c4a2aae22 Mon Sep 17 00:00:00 2001 From: Eric Date: Mon, 12 Dec 2022 02:00:12 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20fix=20refresh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/admin.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pages/admin.tsx b/pages/admin.tsx index 0d05a46..7e46540 100644 --- a/pages/admin.tsx +++ b/pages/admin.tsx @@ -204,6 +204,9 @@ const Admin = (props: Props) => { const onChangeRole = async (e: React.ChangeEvent, user: User) => { const body = { selectedUserEmail: user.email, selectedUserRole: e.target.value } fetcher('/api/user/update', 'PUT', body) + setTimeout(() => { + router.refresh(); + }, 2000) }; const onDeleteUser = async (userEmail: string) => { @@ -366,7 +369,6 @@ const Admin = (props: Props) => { {isSuperAdmin && } - } {info.role !== Role.SELLER && }