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.

wip

Kiran Ke8307b3093cf
diff --git a/apps/web/app/api/links/bulk/route.ts b/apps/web/app/api/links/bulk/route.ts
index af962e57b2..7bf65b9b8e 100644
--- a/apps/web/app/api/links/bulk/route.ts
+++ b/apps/web/app/api/links/bulk/route.ts
@@ -49,9 +49,10 @@ export const POST = withAuth(
const errors = processedLinks
.filter(({ error }) => error)
- .map(({ link, error }) => ({
+ .map(({ link, error, code }) => ({
link,
error,
+ code
}));
const validLinksResponse =
@@ -59,8 +60,6 @@ export const POST = withAuth(
? await bulkCreateLinks({ links: validLinks })
: [];
- // TODO: Kiran
- // Handle error in the response
return NextResponse.json([...validLinksResponse, ...errors], { headers });
} catch (error) {
return handleAndReturnErrorResponse(error);
diff --git a/apps/web/lib/api/links.ts b/apps/web/lib/api/links.ts
index 3feba35456..6b2c08779c 100644
--- a/apps/web/lib/api/links.ts
+++ b/apps/web/lib/api/links.ts
@@ -456,6 +456,7 @@ export async function addLink(link: LinkProps) {
},
});
}
+
const shortLink = linkConstructor({
domain: response.domain,
key: response.key,