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.

fix the filter

Kiran Kfe034b1c2fef
diff --git a/apps/web/app/api/links/route.ts b/apps/web/app/api/links/route.ts
index b7e3600b55..167c73e670 100644
--- a/apps/web/app/api/links/route.ts
+++ b/apps/web/app/api/links/route.ts
@@ -35,7 +35,6 @@ export const GET = withWorkspace(
includeWebhooks,
includeDashboard,
linkIds,
- showProgramLinks,
} = getLinksQuerySchemaExtended.parse(searchParams);
if (domain) {
@@ -58,7 +57,6 @@ export const GET = withWorkspace(
includeWebhooks,
includeDashboard,
linkIds,
- showProgramLinks,
});
return NextResponse.json(response, {
diff --git a/apps/web/lib/api/links/get-links-count.ts b/apps/web/lib/api/links/get-links-count.ts
index 1f0bd14037..e0638df294 100644
--- a/apps/web/lib/api/links/get-links-count.ts
+++ b/apps/web/lib/api/links/get-links-count.ts
@@ -21,7 +21,6 @@ export async function getLinksCount({
userId,
showArchived,
withTags,
- showProgramLinks,
} = searchParams;
const combinedTagIds = combineTagIds({ tagId, tagIds });
@@ -49,7 +48,7 @@ export async function getLinksCount({
groupBy !== "userId" && {
userId,
}),
- ...(!showProgramLinks && { programId: null }),
+ programId: null,
};
if (groupBy === "tagId") {
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 72ba2b0175..2761945ff6 100644
--- a/apps/web/lib/api/links/get-links-for-workspace.ts
+++ b/apps/web/lib/api/links/get-links-for-workspace.ts
@@ -21,7 +21,6 @@ export async function getLinksForWorkspace({
includeWebhooks,
includeDashboard,
linkIds,
- showProgramLinks
}: z.infer<typeof getLinksQuerySchemaExtended> & {
workspaceId: string;
}) {
@@ -66,7 +65,7 @@ export async function getLinksForWorkspace({
: {}),
...(userId && { userId }),
...(linkIds && { id: { in: linkIds } }),
- ...(!showProgramLinks && { programId: null }),
+ programId: null,
},
include: {
tags: {
diff --git a/apps/web/lib/zod/schemas/links.ts b/apps/web/lib/zod/schemas/links.ts
index 5ea7bb0f87..7b450e4c02 100644
--- a/apps/web/lib/zod/schemas/links.ts
+++ b/apps/web/lib/zod/schemas/links.ts
@@ -90,7 +90,6 @@ export const getLinksCountQuerySchema = LinksQuerySchema.merge(
.union([z.literal("domain"), z.literal("tagId"), z.literal("userId")])
.optional()
.describe("The field to group the links by."),
- showProgramLinks: booleanQuerySchema.optional().default("false"),
}),
);
@@ -601,7 +600,6 @@ export const getLinksQuerySchemaExtended = getLinksQuerySchema.merge(
.transform((v) => (Array.isArray(v) ? v : v.split(",")))
.optional()
.describe("Link IDs to filter by."),
- showProgramLinks: booleanQuerySchema.optional().default("false"),
}),
);