File tree Expand file tree Collapse file tree
src/services/subscription Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -89,17 +89,17 @@ subscriptionRouter.post(
8989 } ) ;
9090 }
9191
92- // Get email addresses for all subscribed users ( batch to avoid URL length limits)
92+ // need to batch to avoid URL length limits
9393 const userIds = subscriptions . map ( ( sub ) => sub . userId ) ;
94- const BATCH_SIZE = 100 ; // Process in smaller batches
94+ const BATCH_SIZE = 100 ;
9595 const emailAddresses : string [ ] = [ ] ;
96-
96+
9797 for ( let i = 0 ; i < userIds . length ; i += BATCH_SIZE ) {
9898 const batch = userIds . slice ( i , i + BATCH_SIZE ) ;
9999 const { data : users } = await SupabaseDB . AUTH_INFO . select ( "email" )
100100 . in ( "userId" , batch )
101101 . throwOnError ( ) ;
102-
102+
103103 const batchEmails = users ?. map ( ( user ) => user . email ) || [ ] ;
104104 emailAddresses . push ( ...batchEmails ) ;
105105 }
@@ -179,13 +179,13 @@ subscriptionRouter.get(
179179 const userIds = subscriptions . map ( ( sub ) => sub . userId ) ;
180180 const BATCH_SIZE = 100 ; // Process in smaller batches
181181 const emailAddresses : string [ ] = [ ] ;
182-
182+
183183 for ( let i = 0 ; i < userIds . length ; i += BATCH_SIZE ) {
184184 const batch = userIds . slice ( i , i + BATCH_SIZE ) ;
185185 const { data : users } = await SupabaseDB . AUTH_INFO . select ( "email" )
186186 . in ( "userId" , batch )
187187 . throwOnError ( ) ;
188-
188+
189189 const batchEmails = users ?. map ( ( user ) => user . email ) || [ ] ;
190190 emailAddresses . push ( ...batchEmails ) ;
191191 }
You can’t perform that action at this time.
0 commit comments