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.

Little types cleanup

Tim Wilson73033cc7a186
diff --git a/apps/web/app/api/cron/import/csv/utils.ts b/apps/web/app/api/cron/import/csv/utils.ts
index 06ae624206..bfeddf7de4 100644
--- a/apps/web/app/api/cron/import/csv/utils.ts
+++ b/apps/web/app/api/cron/import/csv/utils.ts
@@ -37,10 +37,10 @@ export const importLinksFromCSV = async ({
const validLinks = processedLinks
.filter(({ error }) => error == null)
- .map(({ link }) => link);
+ .map(({ link }) => link) as ProcessedLinkProps[];
const importedLinks = await bulkCreateLinks({
- links: validLinks as ProcessedLinkProps[],
+ links: validLinks,
});
count += importedLinks.length;
diff --git a/apps/web/app/api/links/bulk/route.ts b/apps/web/app/api/links/bulk/route.ts
index e95d25979c..36a6f015fe 100644
--- a/apps/web/app/api/links/bulk/route.ts
+++ b/apps/web/app/api/links/bulk/route.ts
@@ -61,7 +61,7 @@ export const POST = withAuth(
let validLinks = processedLinks
.filter(({ error }) => error == null)
- .map(({ link }) => link);
+ .map(({ link }) => link) as ProcessedLinkProps[];
let errorLinks = processedLinks
.filter(({ error }) => error != null)
@@ -101,9 +101,7 @@ export const POST = withAuth(
});
const validLinksResponse =
- validLinks.length > 0
- ? await bulkCreateLinks({ links: validLinks as ProcessedLinkProps[] })
- : [];
+ validLinks.length > 0 ? await bulkCreateLinks({ links: validLinks }) : [];
return NextResponse.json([...validLinksResponse, ...errorLinks], {
headers,