Skip to content

Commit

Permalink
fix: Prompt to join org without organization feature flags (#9280)
Browse files Browse the repository at this point in the history
When no organization feature flag was present, we would not show the
prompt to join org notification.
  • Loading branch information
Dschoordsch authored Dec 13, 2023
1 parent 42bde5e commit 117cd57
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const addOrg = async (
const org = {
id: orgId,
activeDomain,
featureFlags: featureFlags ?? [],
featureFlags,
tier: tier ?? 'starter'
}

Expand Down
4 changes: 2 additions & 2 deletions packages/server/utils/isRequestToJoinDomainAllowed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const getEligibleOrgIdsByDomain = async (
const orgs = await r
.table('Organization')
.getAll(activeDomain, {index: 'activeDomain'})
.filter((org: RDatum) => org('featureFlags').contains('noPromptToJoinOrg').not())
.filter((org: RDatum) => org('featureFlags').default([]).contains('noPromptToJoinOrg').not())
.merge((org: RDatum) => ({
members: r
.table('OrganizationUser')
Expand All @@ -33,7 +33,7 @@ export const getEligibleOrgIdsByDomain = async (
.merge((org: RDatum) => ({
founder: org('members').nth(0).default(null),
billingLeads: org('members')
.filter({inactive: false})
.filter({inactive: false, removedAt: null})
.filter((row: RDatum) => r.expr(['BILLING_LEADER', 'ORG_ADMIN']).contains(row('role'))),
activeMembers: org('members').filter({inactive: false, removedAt: null}).count()
}))
Expand Down

0 comments on commit 117cd57

Please sign in to comment.