From 25d5e8f1ad895a1c9ba4d127e91fd26160597fac Mon Sep 17 00:00:00 2001 From: Jose Buitron Date: Wed, 22 Nov 2023 13:19:29 -0500 Subject: [PATCH] fix: Fixed error in type --- src/collaboration/membershipsUtils.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/collaboration/membershipsUtils.ts b/src/collaboration/membershipsUtils.ts index f2767324e..966099fca 100644 --- a/src/collaboration/membershipsUtils.ts +++ b/src/collaboration/membershipsUtils.ts @@ -57,7 +57,7 @@ export type Membership = { export const extractMembershipsInfo = ( membershipList?: MembershipQuery | null, -): MembershipInfo => ({ +): MembershipsInfo => ({ totalCount: membershipList?.membershipsCount ?? membershipList?.memberships?.totalCount, pendingCount: membershipList?.pending?.totalCount, @@ -75,7 +75,9 @@ export const extractMembership = ( userId: membership.user?.id, }); -export const extractMemberships = (membershipList?: MembershipQuery | null): Membership[] => +export const extractMemberships = ( + membershipList?: MembershipQuery | null, +): Membership[] => ( ( membershipList as @@ -84,8 +86,7 @@ export const extractMemberships = (membershipList?: MembershipQuery | null): Mem | null | undefined )?.memberships?.edges || [] - ) - .map(edge => extractMembership(edge.node) as Membership); + ).map(edge => extractMembership(edge.node) as Membership); export const extractAccountMembership = ( membershipList?: AccountCollaborationMembershipFragment | null,