Skip to content

Commit 2ea9ee4

Browse files
committed
formatted
1 parent 4b2a70d commit 2ea9ee4

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/services/subscription/subscription-router.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)