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.

admin exclusions

Steven Teya124988023ad
diff --git a/apps/web/app/api/admin/links/count/route.ts b/apps/web/app/api/admin/links/count/route.ts
index 28a69f9cc7..89edc7c0de 100644
--- a/apps/web/app/api/admin/links/count/route.ts
+++ b/apps/web/app/api/admin/links/count/route.ts
@@ -1,7 +1,7 @@
import { withAdmin } from "@/lib/auth";
import { NextResponse } from "next/server";
import prisma from "@/lib/prisma";
-import { DUB_DOMAINS } from "@dub/utils";
+import { DUB_DOMAINS, LEGAL_USER_ID } from "@dub/utils";
// GET /api/links – get all user links
export const GET = withAdmin(async ({ searchParams }) => {
@@ -38,17 +38,9 @@ export const GET = withAdmin(async ({ searchParams }) => {
in: DUB_DOMAINS.map((domain) => domain.slug),
},
}),
- // when filtering by tagId, only filter by tagId if the filter group is not "Tags"
- ...(tagId &&
- groupBy !== "tagId" && {
- tagId,
- }),
- // for the "Tags" filter group, only count links that have a tagId
- ...(groupBy === "tagId" && {
- NOT: {
- tagId: null,
- },
- }),
+ userId: {
+ not: LEGAL_USER_ID,
+ },
},
_count: true,
orderBy: {
diff --git a/apps/web/app/api/admin/links/route.ts b/apps/web/app/api/admin/links/route.ts
index 359d009735..20341b931e 100644
--- a/apps/web/app/api/admin/links/route.ts
+++ b/apps/web/app/api/admin/links/route.ts
@@ -1,7 +1,7 @@
import { withAdmin } from "@/lib/auth";
import { NextResponse } from "next/server";
import prisma from "@/lib/prisma";
-import { DUB_DOMAINS } from "@dub/utils";
+import { DUB_DOMAINS, LEGAL_USER_ID } from "@dub/utils";
// GET /api/links – get all user links
export const GET = withAdmin(async ({ searchParams }) => {
@@ -39,8 +39,9 @@ export const GET = withAdmin(async ({ searchParams }) => {
},
],
}),
- ...(tagId && { tagId }),
- ...(userId && { userId }),
+ userId: {
+ not: LEGAL_USER_ID,
+ },
},
include: {
user: true,
diff --git a/apps/web/ui/links/link-filters.tsx b/apps/web/ui/links/link-filters.tsx
index 90d3c7f682..fa1528f295 100644
--- a/apps/web/ui/links/link-filters.tsx
+++ b/apps/web/ui/links/link-filters.tsx
@@ -79,9 +79,9 @@ export default function LinkFilters() {
<>
<TagsFilter tags={tags} tagsCount={tagsCount} />
<MyLinksFilter />
+ <ArchiveFilter />
</>
)}
- <ArchiveFilter />
</div>
) : (
<div className="grid h-full gap-6 rounded-md bg-white p-5">