The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
final changes
Steven Teya8af0c404138
diff --git a/apps/web/lib/tinybird/record-click.ts b/apps/web/lib/tinybird/record-click.tsindex 6bcde7a3ab..b42e96d658 100644--- a/apps/web/lib/tinybird/record-click.ts+++ b/apps/web/lib/tinybird/record-click.ts@@ -93,9 +93,9 @@ export async function recordClick({},).then((res) => res.json()),- // increment the click count for the link or domain (based on their ID)+ // increment the click count for the link (based on their ID)conn.execute(- "UPDATE Project p JOIN Link l ON p.id = l.projectId SET p.usage = p.usage + 1 WHERE l.id = ?",+ "UPDATE Link SET clicks = clicks + 1, lastClicked = NOW() WHERE id = ?",[linkId],),// if the link has a destination URL, increment the usage count for the workspacediff --git a/apps/web/scripts/migrate-domains.ts b/apps/web/scripts/migrate-domains.tsindex 132657f8aa..5b82c77765 100644--- a/apps/web/scripts/migrate-domains.ts+++ b/apps/web/scripts/migrate-domains.ts@@ -4,9 +4,6 @@ import "dotenv-flow/config";// Standardize domains into linksasync function main() {const domains = await prisma.domain.findMany({- where: {- projectId: "cl7wsy2836920mjrb352g5wfx",- },include: {project: {select: {@@ -21,7 +18,8 @@ async function main() {},},},- // take: 5000, // TODO: Adjust this based on the number of domains+ skip: 0,+ take: 1000, // TODO: Adjust this based on the number of domains});// Create links for each domaindiff --git a/apps/web/ui/analytics/bar-list.tsx b/apps/web/ui/analytics/bar-list.tsxindex add0ef0ace..ba5250567a 100644--- a/apps/web/ui/analytics/bar-list.tsx+++ b/apps/web/ui/analytics/bar-list.tsx@@ -36,7 +36,6 @@ export default function BarList({const [search, setSearch] = useState("");// TODO: mock pagination for better perf in React- // TODO: fix for top links since it's technically link IDsconst filteredData = useMemo(() => {if (limit) {return data.slice(0, limit);