diff --git a/src/groups/GroupsSection.tsx b/src/groups/GroupsSection.tsx index e0ba3d0c78..0a6ff837d9 100644 --- a/src/groups/GroupsSection.tsx +++ b/src/groups/GroupsSection.tsx @@ -60,14 +60,16 @@ export const GroupsSection = () => { setIsCreateModalOpen(!isCreateModalOpen); }; - const deleteGroup = (group: GroupRepresentation) => { + const deleteGroup = async (group: GroupRepresentation) => { try { - return adminClient.groups.del({ + await adminClient.groups.del({ id: group.id!, }); + addAlert(t("groupDelete"), AlertVariant.success); } catch (error) { addAlert(t("groupDeleteError", { error }), AlertVariant.danger); } + return true; }; const multiDelete = async () => { @@ -147,8 +149,7 @@ export const GroupsSection = () => { { title: t("common:delete"), onRowClick: async (group: GroupRepresentation) => { - await deleteGroup(group); - return true; + return deleteGroup(group); }, }, ]}