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.

remove unstable_cache

Steven Tey1ad2c573283b
diff --git a/apps/web/lib/actions/get-events.ts b/apps/web/lib/actions/get-events.ts
index 44cfb4969f..88d86ef6c3 100644
--- a/apps/web/lib/actions/get-events.ts
+++ b/apps/web/lib/actions/get-events.ts
@@ -5,27 +5,24 @@ import {
LeadEvent,
SaleEvent,
} from "dub/dist/commonjs/models/components";
-import { unstable_cache } from "next/cache";
import { EventType } from "../analytics/types";
import { dub } from "../dub";
export type ConversionEvent = ClickEvent | LeadEvent | SaleEvent;
-export const getEvents = unstable_cache(
- async ({
+export const getEvents = async ({
+ linkId,
+ event,
+ page,
+}: {
+ linkId: string;
+ event: EventType;
+ page: number;
+}) => {
+ return (await dub.events.list({
linkId,
event,
+ interval: "all",
page,
- }: {
- linkId: string;
- event: EventType;
- page: number;
- }) => {
- return (await dub.events.list({
- linkId,
- event,
- interval: "all",
- page,
- })) as ConversionEvent[];
- },
-);
+ })) as ConversionEvent[];
+};
diff --git a/apps/web/lib/actions/get-total-events.ts b/apps/web/lib/actions/get-total-events.ts
index 0d80094a20..c227c55e78 100644
--- a/apps/web/lib/actions/get-total-events.ts
+++ b/apps/web/lib/actions/get-total-events.ts
@@ -2,12 +2,12 @@
import { dub } from "@/lib/dub";
import { AnalyticsCount } from "dub/dist/commonjs/models/components";
-import { unstable_cache } from "next/cache";
-export const getTotalEvents = unstable_cache(async (linkId: string) => {
+export const getTotalEvents = async (linkId: string) => {
+ console.log("getTotalEvents", linkId);
return (await dub.analytics.retrieve({
linkId,
event: "composite",
interval: "all_unfiltered",
})) as AnalyticsCount;
-});
+};