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 = () => { ...@@ -20,6 +20,7 @@ export const AdminListOrgsPages: FC = () => {
const navIndex = useSelector((state: StoreState) => state.navIndex); const navIndex = useSelector((state: StoreState) => state.navIndex);
const navModel = getNavModel(navIndex, 'global-orgs'); const navModel = getNavModel(navIndex, 'global-orgs');
const [state, fetchOrgs] = useAsyncFn(async () => await getOrgs(), []); const [state, fetchOrgs] = useAsyncFn(async () => await getOrgs(), []);
useEffect(() => { useEffect(() => {
fetchOrgs(); fetchOrgs();
}, []); }, []);
...@@ -44,7 +45,7 @@ export const AdminListOrgsPages: FC = () => { ...@@ -44,7 +45,7 @@ export const AdminListOrgsPages: FC = () => {
</VerticalGroup> </VerticalGroup>
</InfoBox> </InfoBox>
<div className="page-action-bar__spacer"></div> <div className="page-action-bar__spacer" />
<LinkButton icon="plus" href="org/new"> <LinkButton icon="plus" href="org/new">
New org New org
</LinkButton> </LinkButton>
...@@ -55,8 +56,7 @@ export const AdminListOrgsPages: FC = () => { ...@@ -55,8 +56,7 @@ export const AdminListOrgsPages: FC = () => {
<AdminOrgsTable <AdminOrgsTable
orgs={state.value} orgs={state.value}
onDelete={orgId => { onDelete={orgId => {
deleteOrg(orgId); deleteOrg(orgId).then(() => fetchOrgs());
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