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.

update lastClicked

Kiran Kd8bd519face5
diff --git a/apps/web/lib/tinybird/record-click.ts b/apps/web/lib/tinybird/record-click.ts
index e0cae5077b..63e249b13e 100644
--- a/apps/web/lib/tinybird/record-click.ts
+++ b/apps/web/lib/tinybird/record-click.ts
@@ -130,7 +130,10 @@ export async function recordClick({
// increment the click count for the link (based on their ID)
prismaEdge.link.update({
where: { id: linkId },
- data: { clicks: { increment: 1 } },
+ data: {
+ clicks: { increment: 1 },
+ lastClicked: new Date(),
+ },
}),
// if the link has a destination URL, increment the usage count for the workspace
// and then we have a cron that will reset it at the start of new billing cycle