Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

fix ts errors

Steven Tey33668c31bf52
diff --git a/apps/web/app/api/cron/year-in-review/route.ts b/apps/web/app/api/cron/year-in-review/route.ts
index 59359eaefd..8a64bd9e24 100644
--- a/apps/web/app/api/cron/year-in-review/route.ts
+++ b/apps/web/app/api/cron/year-in-review/route.ts
@@ -108,8 +108,7 @@ export async function POST(req: Request) {
console.log(
`πŸ“¨ Recipients:`,
- // @ts-ignore
- batch.map(({ email }) => email.to),
+ batch.map((b) => b.email.to),
);
if (batch.length === 0) {
@@ -117,7 +116,7 @@ export async function POST(req: Request) {
}
const { data, error } = await resend.batch.send(
- batch.map(({ email }) => email),
+ batch.map((b) => b.email),
);
console.log("πŸš€ ~ data:", data);
diff --git a/apps/web/scripts/dub-wrapped.ts b/apps/web/scripts/dub-wrapped.ts
index 883cc7e698..395a460078 100644
--- a/apps/web/scripts/dub-wrapped.ts
+++ b/apps/web/scripts/dub-wrapped.ts
@@ -50,8 +50,8 @@ async function main() {
},
take: 20,
})
- // only get projects with more than 5 links created in 2024
- .then((data) => data.filter(({ _count }) => _count.id > 5));
+ // only get projects with at least 5 links created in 2024
+ .then((data) => data.filter(({ _count }) => _count.id >= 5));
const payloads = await Promise.all(
data.map(async ({ projectId, _count, _sum }) => {
@@ -95,4 +95,5 @@ async function main() {
});
}
+// watch -n 10 npm run script dub-wrapped
main();