The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Fix workspace resolver when billing is not enabled (#17333)
Weiko4c565425c5ca
diff --git a/packages/twenty-server/src/engine/core-modules/billing/services/billing-subscription.service.ts b/packages/twenty-server/src/engine/core-modules/billing/services/billing-subscription.service.tsindex 4ae2a27c3ba..3d74a0a1511 100644--- a/packages/twenty-server/src/engine/core-modules/billing/services/billing-subscription.service.ts+++ b/packages/twenty-server/src/engine/core-modules/billing/services/billing-subscription.service.ts@@ -184,9 +184,11 @@ export class BillingSubscriptionService {this.twentyConfigService.get('ENTERPRISE_KEY'),);- const entitlements = await this.billingEntitlementRepository.find({- where: { workspaceId },- });+ const entitlements = isBillingEnabled+ ? await this.billingEntitlementRepository.find({+ where: { workspaceId },+ })+ : [];const entitlementsByKey = entitlements.reduce((acc, entitlement) => {