The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Update route.ts
Steven Teya529a6283dd8
diff --git a/apps/web/app/api/links/[linkId]/route.ts b/apps/web/app/api/links/[linkId]/route.tsindex 91e587fb59..9c2bdfeaa5 100644--- a/apps/web/app/api/links/[linkId]/route.ts+++ b/apps/web/app/api/links/[linkId]/route.ts@@ -62,7 +62,7 @@ export const PATCH = withWorkspace(linkId: params.linkId,});- const body = updateLinkBodySchema.parse(await parseRequestBody(req))!;+ const body = updateLinkBodySchema.parse(await parseRequestBody(req)) || {};// Add body onto existing link but maintain NewLinkProps form for processLinkconst updatedLink = {@@ -73,7 +73,8 @@ export const PATCH = withWorkspace(: link.expiresAt,geo: link.geo as NewLinkProps["geo"],...body,- // for UTM tags, we only pass them to processLink if they have changed+ // for UTM tags, we only pass them to processLink if they have changed from their previous value+ // or else they will override any changes to the UTM params in the destination URL...Object.fromEntries(UTMTags.map((tag) => [tag,