Wait for group to be deleted before navigating (#1634)

This commit is contained in:
Jon Koops 2021-12-03 12:16:07 +01:00 committed by GitHub
parent 72c34e0d46
commit d7973a8008
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -48,7 +48,7 @@ export default function GroupsSection() {
await adminClient.groups.del({
id: group.id!,
});
addAlert(t("groupDelete"), AlertVariant.success);
addAlert(t("groupDeleted", { count: 1 }), AlertVariant.success);
} catch (error) {
addError("groups:groupDeleteError", error);
}
@ -121,8 +121,8 @@ export default function GroupsSection() {
<DropdownItem
data-testid="deleteGroup"
key="deleteGroup"
onClick={() => {
deleteGroup({ id });
onClick={async () => {
await deleteGroup({ id });
history.push(toGroups({ realm }));
}}
>