+
{
+ const response = await updateUserGroup(userGroup.id, {
+ user_ids: userGroup.users
+ .filter(
+ (userGroupUser) => userGroupUser.id !== user.id
+ )
+ .map((userGroupUser) => userGroupUser.id),
+ cc_pair_ids: userGroup.cc_pairs.map(
+ (ccPair) => ccPair.id
+ ),
+ });
+ if (response.ok) {
+ setPopup({
+ message: "Successfully removed user from group",
+ type: "success",
+ });
+ } else {
+ const responseJson = await response.json();
+ const errorMsg =
+ responseJson.detail || responseJson.message;
+ setPopup({
+ message: `Error removing user from group - ${errorMsg}`,
+ type: "error",
+ });
+ }
+ refreshUserGroup();
+ }}
+ >
+
+
+
+ ),
+ };
+ })}
+ />
+ ) : (
+ No users in this group...
+ )}
+