fix: getting an error when a team member tries to leave (#15925)
a team Co-authored-by: Somay Chauhan <[email protected]> Co-authored-by: Amit Sharma <[email protected]>
This commit is contained in:
1 file changed
+4
-1
@@ -28,7 +28,10 @@ export const removeMemberHandler = async ({ ctx, input }: RemoveMemberOptions) =
|
||||
});
|
||||
|
||||
const { memberIds, teamIds, isOrg } = input;
|
||||
const isAdmin = teamIds.every(async (teamId) => await isTeamAdmin(ctx.user.id, teamId));
|
||||
|
||||
const isAdmin = await Promise.all(
|
||||
teamIds.map(async (teamId) => await isTeamAdmin(ctx.user.id, teamId))
|
||||
).then((results) => results.every((result) => result));
|
||||
|
||||
const isOrgAdmin = ctx.user.profile?.organizationId
|
||||
? await isTeamAdmin(ctx.user.id, ctx.user.profile?.organizationId)
|
||||
|
||||
Reference in new issue
Block a user