parent
c1282b2973
commit
db4f7851fb
1 changed files with 5 additions and 4 deletions
|
@ -60,14 +60,16 @@ export const GroupsSection = () => {
|
||||||
setIsCreateModalOpen(!isCreateModalOpen);
|
setIsCreateModalOpen(!isCreateModalOpen);
|
||||||
};
|
};
|
||||||
|
|
||||||
const deleteGroup = (group: GroupRepresentation) => {
|
const deleteGroup = async (group: GroupRepresentation) => {
|
||||||
try {
|
try {
|
||||||
return adminClient.groups.del({
|
await adminClient.groups.del({
|
||||||
id: group.id!,
|
id: group.id!,
|
||||||
});
|
});
|
||||||
|
addAlert(t("groupDelete"), AlertVariant.success);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
addAlert(t("groupDeleteError", { error }), AlertVariant.danger);
|
addAlert(t("groupDeleteError", { error }), AlertVariant.danger);
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
const multiDelete = async () => {
|
const multiDelete = async () => {
|
||||||
|
@ -147,8 +149,7 @@ export const GroupsSection = () => {
|
||||||
{
|
{
|
||||||
title: t("common:delete"),
|
title: t("common:delete"),
|
||||||
onRowClick: async (group: GroupRepresentation) => {
|
onRowClick: async (group: GroupRepresentation) => {
|
||||||
await deleteGroup(group);
|
return deleteGroup(group);
|
||||||
return true;
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
|
|
Loading…
Reference in a new issue