Commit 208f95a7 by Alex Khomenko Committed by GitHub

Admin: Update org list after delete (#26277)

parent 23e93175
......@@ -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 = () => {
</VerticalGroup>
</InfoBox>
<div className="page-action-bar__spacer"></div>
<div className="page-action-bar__spacer" />
<LinkButton icon="plus" href="org/new">
New org
</LinkButton>
......@@ -55,8 +56,7 @@ export const AdminListOrgsPages: FC = () => {
<AdminOrgsTable
orgs={state.value}
onDelete={orgId => {
deleteOrg(orgId);
fetchOrgs();
deleteOrg(orgId).then(() => fetchOrgs());
}}
/>
)}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment