The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
some bug fixes
Steven Tey881081fe8082
diff --git a/components/stats/toggle.tsx b/components/stats/toggle.tsxindex 2026b6198a..d271d06d94 100644--- a/components/stats/toggle.tsx+++ b/components/stats/toggle.tsx@@ -112,27 +112,6 @@ export default function Toggle({/></button></Popover>- {/* <div className="rounded-md border border-gray-100 bg-white px-3 py-1 shadow-md">- <BadgeSelect- options={INTERVALS}- selected={currentInterval}- // @ts-ignore- selectAction={(interval) => {- router.push(- {- query: {- ...router.query,- interval,- },- },- `/${pageType}/${encodeURI(- router.query.key as string,- )}?interval=${interval}`,- { shallow: true },- );- }}- />- </div> */}</div></div>);diff --git a/pages/api/edge/links/[key]/clicks.ts b/pages/api/edge/links/[key]/clicks.tsindex 820e338043..533ddb1ff2 100644--- a/pages/api/edge/links/[key]/clicks.ts+++ b/pages/api/edge/links/[key]/clicks.ts@@ -18,11 +18,13 @@ export default async function handler(req: NextRequest) {let clicks = 0;try {clicks = response.rows[0]["clicks"];+ return new Response(JSON.stringify(clicks), { status: 200 });} catch (e) {console.log(e);}- return new Response(JSON.stringify(clicks), { status: 200 });}++ // if Planetscale fails or no interval is provided, get the total clicks from Tinybirdconst response = await getStats({domain: "dub.sh",key,