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 backfill-customers.ts

Kiran K9566aaf15292
diff --git a/apps/web/scripts/backfill-customers.ts b/apps/web/scripts/backfill-customers.ts
index 300d1d8ac6..044e602a37 100644
--- a/apps/web/scripts/backfill-customers.ts
+++ b/apps/web/scripts/backfill-customers.ts
@@ -7,7 +7,7 @@ import "dotenv-flow/config";
async function main() {
const customers = await prisma.customer.findMany({
where: {
- // linkId: null,
+ linkId: null,
},
select: {
id: true,
@@ -50,8 +50,6 @@ async function main() {
(click) => click?.click_id === leadEvent?.click_id,
);
- console.log(leadEvent, clickEvent);
-
if (!leadEvent || !clickEvent) {
return;
}
@@ -59,9 +57,9 @@ async function main() {
return prisma.customer.update({
where: { id: customer.id },
data: {
- linkId: leadEvent.link_id,
- clickId: leadEvent.click_id,
- country: leadEvent.country,
+ linkId: clickEvent.link_id,
+ clickId: clickEvent.click_id,
+ country: clickEvent.country,
clickedAt: clickEvent.timestamp,
},
select: {