Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 541aeef

Browse files
#169 - Confirm before removing user from group
1 parent e7a1afc commit 541aeef

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

client/src/components/UserGroup/index.jsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ export default function UserGroup({
99
removeGroup,
1010
showManageGroupsModal,
1111
}) {
12+
const confirmRemoveGroup = (group) => {
13+
if (
14+
window.confirm(`Are you sure you want to remove the user from the group?`)
15+
) {
16+
removeGroup(group);
17+
}
18+
};
1219
return (
1320
<>
1421
<div className={styles.groupHeading}>
@@ -25,7 +32,7 @@ export default function UserGroup({
2532
key={group.id}
2633
name={group.name}
2734
removable={true}
28-
onRemove={() => removeGroup(group)}
35+
onRemove={() => confirmRemoveGroup(group)}
2936
/>
3037
);
3138
})}

0 commit comments

Comments
 (0)