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 clicks.ts

Steven Tey3d5f395ca9d3
diff --git a/apps/web/lib/analytics/clicks.ts b/apps/web/lib/analytics/clicks.ts
index 0d5ce2ac63..a333b8ac1e 100644
--- a/apps/web/lib/analytics/clicks.ts
+++ b/apps/web/lib/analytics/clicks.ts
@@ -73,5 +73,7 @@ export const getClicks = async (
}),
);
- return res.data;
+ // for total clicks (groupBy undefined), we return just the value;
+ // everything else we return an array of values
+ return groupBy ? res.data : res.data[0];
};