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.

improve search

Steven Tey3ec98df50415
diff --git a/apps/web/app/api/admin/links/route.ts b/apps/web/app/api/admin/links/route.ts
index 9761eee5fc..310eb9c140 100644
--- a/apps/web/app/api/admin/links/route.ts
+++ b/apps/web/app/api/admin/links/route.ts
@@ -36,9 +36,21 @@ export const GET = withAdmin(async ({ searchParams }) => {
in: DUB_DOMAINS_ARRAY,
},
}),
- ...(search && {
- shortLink: search,
- }),
+ ...(search &&
+ (search.startsWith("https://")
+ ? {
+ shortLink: search,
+ }
+ : {
+ OR: [
+ {
+ shortLink: { contains: search },
+ },
+ {
+ url: { contains: search },
+ },
+ ],
+ })),
},
include: {
user: true,