diff --git a/package.json b/package.json index 4e548d017..54a90d800 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "staart-manager", - "version": "1.1.40", + "version": "1.1.41", "main": "index.js", "repository": "git@github.com:AnandChowdhary/staart.git", "author": "Anand Chowdhary ", @@ -147,5 +147,5 @@ "setup" ], "snyk": true, - "staart-version": "1.1.40" + "staart-version": "1.1.41" } \ No newline at end of file diff --git a/src/rest/organization.ts b/src/rest/organization.ts index 107ed6ebf..5e7b69cc9 100644 --- a/src/rest/organization.ts +++ b/src/rest/organization.ts @@ -618,7 +618,7 @@ export const deleteOrganizationMembershipForUser = async ( ) { // Check if there's only one member in this team const members = await getOrganizationMemberships(organizationId); - if (members && members.data && members.length === 1) + if (members && members.data && members.data.length === 1) throw new Error(ErrorCode.CANNOT_DELETE_SOLE_MEMBER); return await deleteOrganizationMembership(organizationId, membershipId); }