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.

filter the links by tenantId

Kiran K6a62358fb444
diff --git a/apps/web/app/api/links/route.ts b/apps/web/app/api/links/route.ts
index 167c73e670..6f635622d2 100644
--- a/apps/web/app/api/links/route.ts
+++ b/apps/web/app/api/links/route.ts
@@ -35,6 +35,7 @@ export const GET = withWorkspace(
includeWebhooks,
includeDashboard,
linkIds,
+ tenantId,
} = getLinksQuerySchemaExtended.parse(searchParams);
if (domain) {
@@ -57,6 +58,7 @@ export const GET = withWorkspace(
includeWebhooks,
includeDashboard,
linkIds,
+ tenantId,
});
return NextResponse.json(response, {
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 43856a499c..a6d406c9f8 100644
--- a/apps/web/lib/api/links/get-links-for-workspace.ts
+++ b/apps/web/lib/api/links/get-links-for-workspace.ts
@@ -21,6 +21,7 @@ export async function getLinksForWorkspace({
includeWebhooks,
includeDashboard,
linkIds,
+ tenantId,
}: z.infer<typeof getLinksQuerySchemaExtended> & {
workspaceId: string;
}) {
@@ -65,6 +66,7 @@ export async function getLinksForWorkspace({
: {}),
...(userId && { userId }),
...(linkIds && { id: { in: linkIds } }),
+ ...(tenantId && { tenantId }),
},
include: {
tags: {