File tree 1 file changed +14
-1
lines changed
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ import { Flags } from '~/shared/utils';
51
51
import { CashWithdrawalMethod , CashWithdrawalStatus } from '~/shared/utils/prisma/enums' ;
52
52
import { withRetries } from '~/utils/errorHandling' ;
53
53
import { signalClient } from '~/utils/signal-client' ;
54
+ import { Prisma } from '@prisma/client' ;
54
55
55
56
type UserCapCacheItem = {
56
57
id : number ;
@@ -663,7 +664,19 @@ export async function getPoolParticipants(month?: Date) {
663
664
GROUP BY userId
664
665
HAVING amount > 0;
665
666
` ;
666
- return participants ;
667
+
668
+ let bannedParticipants : { userId : number } [ ] = [ ] ;
669
+
670
+ if ( participants . length > 0 ) {
671
+ bannedParticipants = await dbWrite . $queryRaw < { userId : number } [ ] > `
672
+ SELECT "id" as "userId"
673
+ FROM "User"
674
+ WHERE id IN (${ Prisma . join ( participants . map ( ( p ) => p . userId ) ) } )
675
+ AND ("bannedAt" IS NOT NULL OR onboarding & ${ OnboardingSteps . BannedCreatorProgram } != 0);
676
+ ` ;
677
+ }
678
+
679
+ return participants . filter ( ( p ) => ! bannedParticipants . some ( ( b ) => b . userId === p . userId ) ) ;
667
680
}
668
681
669
682
export const updateCashWithdrawal = async ( {
You can’t perform that action at this time.
0 commit comments