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.

include dashboard

Kiran Kacb2972133d6
diff --git a/apps/web/app/api/links/route.ts b/apps/web/app/api/links/route.ts
index c8b46721ae..167c73e670 100644
--- a/apps/web/app/api/links/route.ts
+++ b/apps/web/app/api/links/route.ts
@@ -33,6 +33,7 @@ export const GET = withWorkspace(
withTags,
includeUser,
includeWebhooks,
+ includeDashboard,
linkIds,
} = getLinksQuerySchemaExtended.parse(searchParams);
@@ -54,6 +55,7 @@ export const GET = withWorkspace(
withTags,
includeUser,
includeWebhooks,
+ includeDashboard,
linkIds,
});
diff --git a/apps/web/app/api/workspaces/[idOrSlug]/stats/route.ts b/apps/web/app/api/workspaces/[idOrSlug]/stats/route.ts
deleted file mode 100644
index d855f48676..0000000000
--- a/apps/web/app/api/workspaces/[idOrSlug]/stats/route.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-// Don't know if we want to keep this route
-
-export * from "../../../dashboards/route";
diff --git a/apps/web/lib/api/links/get-links-for-workspace.ts b/apps/web/lib/api/links/get-links-for-workspace.ts
index 3f48d9da66..17e21243bf 100644
--- a/apps/web/lib/api/links/get-links-for-workspace.ts
+++ b/apps/web/lib/api/links/get-links-for-workspace.ts
@@ -18,6 +18,7 @@ export async function getLinksForWorkspace({
withTags,
includeUser,
includeWebhooks,
+ includeDashboard,
linkIds,
}: z.infer<typeof getLinksQuerySchemaExtended> & {
workspaceId: string;
@@ -78,11 +79,12 @@ export async function getLinksForWorkspace({
},
user: includeUser,
webhooks: includeWebhooks,
+ dashboard: includeDashboard,
},
orderBy: {
[sort]: "desc",
},
- take: pageSize,
+ take: 1,
skip: (page - 1) * pageSize,
});
diff --git a/apps/web/lib/zod/schemas/links.ts b/apps/web/lib/zod/schemas/links.ts
index 96fab3fe45..db091c7c5c 100644
--- a/apps/web/lib/zod/schemas/links.ts
+++ b/apps/web/lib/zod/schemas/links.ts
@@ -594,6 +594,7 @@ export const getLinksQuerySchemaExtended = getLinksQuerySchema.merge(
// Only Dub UI uses the following query parameters
includeUser: booleanQuerySchema.default("false"),
includeWebhooks: booleanQuerySchema.default("false"),
+ includeDashboard: booleanQuerySchema.default("false"),
linkIds: z
.union([z.string(), z.array(z.string())])
.transform((v) => (Array.isArray(v) ? v : v.split(",")))