Skip to content

Commit

Permalink
Manually bisecting changes that break tests (part 1)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmtaber129 committed Nov 27, 2023
1 parent c62c695 commit db90ead
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/server/utils/setUserTierForUserIds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,21 @@ const setUserTierForUserIds = async (userIds: string[]) => {
.getAll(r.args(userIds), {index: 'userId'})
.filter({removedAt: null})
.merge((orgUser: RDatum<OrganizationUser>) => ({
tier: r.table('Organization').get(orgUser('orgId'))('tier').default('starter')
tier: r.table('Organization').get(orgUser('orgId'))('tier').default('starter'),
trialStartDate: r
.db('actionDevelopment')
.table('Organization')
.get(orgUser('orgId'))('trialStartDate')
.default(null)
}))
.group('userId')('tier')
.group('userId')
.ungroup()
.map((row) => ({
id: row('group'),
tier: r.branch(
row('reduction').contains('enterprise'),
row('reduction')('tier').contains('enterprise'),
'enterprise',
row('reduction').contains('team'),
row('reduction')('tier').contains('team'),
'team',
'starter'
)
Expand Down

0 comments on commit db90ead

Please sign in to comment.