diff --git a/src/group/groupSlice.ts b/src/group/groupSlice.ts index 3c2d052052..9694262d3e 100644 --- a/src/group/groupSlice.ts +++ b/src/group/groupSlice.ts @@ -486,7 +486,7 @@ const updateMemberItem = ( 'members.data.membershipsInfo.membershipsSample', state.members.data?.membershipsInfo?.membershipsSample ?.map((membership: Membership) => - _.includes(membership.user.email, userEmails) + _.includes(membership.user?.email, userEmails) ? valueGenerator(membership) : membership ) diff --git a/src/group/groupUtils.ts b/src/group/groupUtils.js similarity index 69% rename from src/group/groupUtils.ts rename to src/group/groupUtils.js index e352c91003..0ab319f76a 100644 --- a/src/group/groupUtils.ts +++ b/src/group/groupUtils.js @@ -1,9 +1,8 @@ import { extractMembershipsInfo } from 'terraso-client-shared/collaboration/membershipsUtils'; import { extractDataEntries } from 'sharedData/sharedDataUtils'; -import { GroupNode } from 'terraso-client-shared/graphqlSchema/graphql'; -export const extractGroup = (group: GroupNode) => ({ +export const extractGroup = group => ({ ...group, membershipsInfo: extractMembershipsInfo(group.membershipList), dataEntries: extractDataEntries(group),