From 562e8111796e583bf3943b3500cbeb8f1a7220fe Mon Sep 17 00:00:00 2001 From: Alex Khomenko Date: Wed, 15 Jul 2020 10:35:00 +0300 Subject: [PATCH] Admin: Update org list after delete (#26277) (cherry picked from commit 208f95a76cd8db5312683ebb748b38d7378aff56) --- public/app/features/admin/AdminListOrgsPage.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/app/features/admin/AdminListOrgsPage.tsx b/public/app/features/admin/AdminListOrgsPage.tsx index 67bb2deacd8..43b4c290efc 100644 --- a/public/app/features/admin/AdminListOrgsPage.tsx +++ b/public/app/features/admin/AdminListOrgsPage.tsx @@ -20,6 +20,7 @@ export const AdminListOrgsPages: FC = () => { const navIndex = useSelector((state: StoreState) => state.navIndex); const navModel = getNavModel(navIndex, 'global-orgs'); const [state, fetchOrgs] = useAsyncFn(async () => await getOrgs(), []); + useEffect(() => { fetchOrgs(); }, []); @@ -44,7 +45,7 @@ export const AdminListOrgsPages: FC = () => { -
+
New org @@ -55,8 +56,7 @@ export const AdminListOrgsPages: FC = () => { { - deleteOrg(orgId); - fetchOrgs(); + deleteOrg(orgId).then(() => fetchOrgs()); }} /> )}