The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Follow up PR for `shortLink`
Steven Tey54ad9b609e66
diff --git a/apps/web/lib/api/links/get-links-for-workspace.ts b/apps/web/lib/api/links/get-links-for-workspace.tsindex 4ccff8eba3..726ea42561 100644--- a/apps/web/lib/api/links/get-links-for-workspace.ts+++ b/apps/web/lib/api/links/get-links-for-workspace.ts@@ -31,7 +31,7 @@ export async function getLinksForWorkspace({...(search && {OR: [{- key: { contains: search },+ shortLink: { contains: search },},{url: { contains: search },diff --git a/apps/web/lib/api/links/utils/transform-link.ts b/apps/web/lib/api/links/utils/transform-link.tsindex d555e29a8c..950d5819d6 100644--- a/apps/web/lib/api/links/utils/transform-link.ts+++ b/apps/web/lib/api/links/utils/transform-link.ts@@ -1,4 +1,3 @@-import { linkConstructor } from "@dub/utils";import { Link, Tag } from "@prisma/client";export type LinkWithTags = Link & {@@ -11,8 +10,6 @@ export const transformLink = (link: LinkWithTags) => {return {...link,- shortLink:- link.shortLink ?? linkConstructor({ domain: link.domain, key: link.key }),tagId: tags?.[0]?.id ?? null, // backwards compatibilitytags,qrCode: `https://api.dub.co/qr?url=${link.shortLink}?qr=1`,diff --git a/apps/web/lib/integrations/slack/slash-commands.ts b/apps/web/lib/integrations/slack/slash-commands.tsindex fd97a60b53..823aa0b585 100644--- a/apps/web/lib/integrations/slack/slash-commands.ts+++ b/apps/web/lib/integrations/slack/slash-commands.ts@@ -163,6 +163,6 @@ const createShortLink = async ({const { shortLink } = await createLink(link);return {- text: shortLink as string, // TODO: Once shortLink is not nullable, we can remove the type assertion+ text: shortLink,};};diff --git a/apps/web/prisma/schema/link.prisma b/apps/web/prisma/schema/link.prismaindex 85fbe716de..e69056aeff 100644--- a/apps/web/prisma/schema/link.prisma+++ b/apps/web/prisma/schema/link.prisma@@ -3,7 +3,7 @@ model Link {domain String // domain of the link (e.g. dub.sh) – also stored on Rediskey String // key of the link (e.g. /github) – also stored on Redisurl String @db.LongText // target url (e.g. https://github.com/dubinc/dub) – also stored on Redis- shortLink String? @unique @db.VarChar(400) // new column for the full short link+ shortLink String @unique @db.VarChar(400) // new column for the full short linkarchived Boolean @default(false) // whether the link is archived or notexpiresAt DateTime? // when the link expires – stored on Redis via ttlexpiredUrl String? @db.LongText // URL to redirect the user to when the link is expired