diff --git a/src/group/groupUtils.ts b/src/group/groupUtils.ts new file mode 100644 index 0000000000..e352c91003 --- /dev/null +++ b/src/group/groupUtils.ts @@ -0,0 +1,10 @@ +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) => ({ + ...group, + membershipsInfo: extractMembershipsInfo(group.membershipList), + dataEntries: extractDataEntries(group), +});