fix format

This commit is contained in:
jenny-s51 2021-05-18 10:47:21 -04:00
parent 4fcc9654dc
commit 07c55b4693

View file

@ -64,26 +64,26 @@ export const JoinGroupDialog = ({
async () => { async () => {
const allGroups = await adminClient.groups.find(); const allGroups = await adminClient.groups.find();
if (groupId) { if (groupId) {
const group = await adminClient.groups.findOne({ id: groupId }); const group = await adminClient.groups.findOne({ id: groupId });
return { group, groups: group.subGroups! }; return { group, groups: group.subGroups! };
} else if (id) { } else if (id) {
const existingUserGroups = await adminClient.users.listGroups({ const existingUserGroups = await adminClient.users.listGroups({
id, id,
}); });
setJoinedGroups(existingUserGroups); setJoinedGroups(existingUserGroups);
return { return {
groups: allGroups, groups: allGroups,
}; };
} else } else
return { return {
groups: allGroups, groups: allGroups,
}; };
}, },
async ({ group: selectedGroup, groups }) => { async ({ group: selectedGroup, groups }) => {
if (selectedGroup) { if (selectedGroup) {
setNavigation([...navigation, selectedGroup]); setNavigation([...navigation, selectedGroup]);
} }
groups.forEach((group: Group) => { groups.forEach((group: Group) => {
group.checked = !!selectedRows.find((r) => r.id === group.id); group.checked = !!selectedRows.find((r) => r.id === group.id);