Skip to content

Commit

Permalink
state validScope type
Browse files Browse the repository at this point in the history
  • Loading branch information
nickoferrall committed Nov 15, 2024
1 parent cf6af28 commit 947178a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/server/dataloader/customLoaderMakers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,10 @@ export const allFeatureFlags = (parent: RootDataLoader) => {
.selectFrom('FeatureFlag')
.selectAll()
.where('expiresAt', '>', new Date())
.$if(scope !== 'all', (qb) => qb.where('scope', '=', scope))
.$if(scope !== 'all', (qb) => {
const validScope = scope as 'Organization' | 'Team' | 'User'
return qb.where('scope', '=', validScope)
})
.orderBy('featureName')
.execute()
return flags.map((flag) => ({...flag, isEnabled: true}))
Expand Down

0 comments on commit 947178a

Please sign in to comment.