The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Simplify expiresAt changes in processLink
Tim Wilson39b151a7470c
diff --git a/apps/web/lib/api/links/process-link.ts b/apps/web/lib/api/links/process-link.tsindex ce5ae07625..4e8e258ce9 100644--- a/apps/web/lib/api/links/process-link.ts+++ b/apps/web/lib/api/links/process-link.ts@@ -50,7 +50,6 @@ export async function processLink<T extends Record<string, any>>({proxy,password,rewrite,- expiresAt: expiresAtRaw,expiredUrl,ios,android,@@ -59,6 +58,8 @@ export async function processLink<T extends Record<string, any>>({createdAt,} = payload;+ let expiresAt: string | Date | null | undefined = payload.expiresAt+const tagIds = combineTagIds(payload);// url checks@@ -83,12 +84,12 @@ export async function processLink<T extends Record<string, any>>({(!workspace || workspace.plan === "free") &&(!createdAt || new Date(createdAt) > new Date("2024-01-19"))) {- if (proxy || password || rewrite || expiresAtRaw || ios || android || geo) {+ if (proxy || password || rewrite || expiresAt || ios || android || geo) {const proFeaturesString = [proxy && "custom social media cards",password && "password protection",rewrite && "link cloaking",- expiresAtRaw && "link expiration",+ expiresAt && "link expiration",ios && "iOS targeting",android && "Android targeting",geo && "geo targeting",@@ -260,11 +261,9 @@ export async function processLink<T extends Record<string, any>>({};}- let expiresAt: Date | null = null;-// expire date checks- if (expiresAtRaw) {- const datetime = parseDateTime(expiresAtRaw);+ if (expiresAt) {+ const datetime = parseDateTime(expiresAt);if (!datetime) {return {link: payload,