diff --git a/services/api/src/resources/environment/resolvers.ts b/services/api/src/resources/environment/resolvers.ts index d48fe8a2ae..8009cf7315 100644 --- a/services/api/src/resources/environment/resolvers.ts +++ b/services/api/src/resources/environment/resolvers.ts @@ -370,7 +370,7 @@ export const addOrUpdateEnvironment: ResolverFn = async ( // check the environment quota, this prevents environments being added directly via the api const curEnvs = await organizationHelpers(sqlClientPool).getEnvironmentsByOrganizationId(projectOpenshift.organization) const curOrg = await organizationHelpers(sqlClientPool).getOrganizationById(projectOpenshift.organization) - if (curEnvs.length >= curOrg.quotaEnvironment) { + if (curEnvs.length >= curOrg.quotaEnvironment && curOrg.quotaEnvironment != -1) { throw new Error( `Environment would exceed organization environment quota: ${curEnvs.length}/${curOrg.quotaEnvironment}` ); diff --git a/services/api/src/resources/group/resolvers.ts b/services/api/src/resources/group/resolvers.ts index e393d9e0b9..c9f06bb188 100644 --- a/services/api/src/resources/group/resolvers.ts +++ b/services/api/src/resources/group/resolvers.ts @@ -331,7 +331,7 @@ export const addGroup: ResolverFn = async ( } } - if (groupCount >= organizationData.quotaGroup) { + if (groupCount >= organizationData.quotaGroup && organizationData.quotaGroup != -1) { throw new Error( `This would exceed this organizations group quota; ${groupCount}/${organizationData.quotaGroup}` ); diff --git a/services/api/src/resources/notification/resolvers.ts b/services/api/src/resources/notification/resolvers.ts index 493f5a9dd6..434495e062 100644 --- a/services/api/src/resources/notification/resolvers.ts +++ b/services/api/src/resources/notification/resolvers.ts @@ -37,7 +37,7 @@ const checkOrgNotificationPermission = async (hasPermission, input) => { }); const orgNotifications = await organizationHelpers(sqlClientPool).getNotificationsForOrganizationId(input.organization); - if (orgNotifications.length >= organizationData.quotaNotification) { + if (orgNotifications.length >= organizationData.quotaNotification && organizationData.quotaNotification != -1) { throw new Error( `This would exceed this organizations notification quota; ${orgNotifications.length}/${organizationData.quotaNotification}` ); diff --git a/services/api/src/resources/project/resolvers.ts b/services/api/src/resources/project/resolvers.ts index fbd8185c9a..a925bfa370 100644 --- a/services/api/src/resources/project/resolvers.ts +++ b/services/api/src/resources/project/resolvers.ts @@ -300,7 +300,7 @@ export const addProject = async ( // check the project quota before adding the project const organization = await organizationHelpers(sqlClientPool).getOrganizationById(input.organization); const projects = await organizationHelpers(sqlClientPool).getProjectsByOrganizationId(input.organization); - if (projects.length >= organization.quotaProject) { + if (projects.length >= organization.quotaProject && organization.quotaProject != -1) { throw new Error( `This would exceed this organizations project quota; ${projects.length}/${organization.quotaProject}` );