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.

small fixes

Steven Teyc5aa376d1a84
diff --git a/apps/web/app/api/cron/import/bitly/utils.ts b/apps/web/app/api/cron/import/bitly/utils.ts
index 9dfbcd392c..736d7db884 100644
--- a/apps/web/app/api/cron/import/bitly/utils.ts
+++ b/apps/web/app/api/cron/import/bitly/utils.ts
@@ -2,8 +2,7 @@ import { bulkCreateLinks } from "@/lib/api/links";
import { linkCache } from "@/lib/api/links/cache";
import {
decodeLinkIfCaseSensitive,
- encodeKey,
- isCaseSensitiveDomain,
+ encodeKeyIfCaseSensitive,
} from "@/lib/api/links/case-sensitivity";
import { qstash } from "@/lib/cron";
import { redis } from "@/lib/upstash";
@@ -174,14 +173,12 @@ export const importLinksFromBitly = async ({
let alreadyCreatedLinks = await prisma.link.findMany({
where: {
shortLink: {
- in: importedLinks.map((link) => {
- if (isCaseSensitiveDomain(link.domain)) {
- return linkConstructorSimple({
- domain: link.domain,
- key: encodeKey(link.key),
- });
- }
- }),
+ in: importedLinks.map((link) =>
+ linkConstructorSimple({
+ domain: link.domain,
+ key: encodeKeyIfCaseSensitive(link),
+ }),
+ ),
},
},
select: {
diff --git a/apps/web/app/api/domains/route.ts b/apps/web/app/api/domains/route.ts
index 20d17f0abf..067e597217 100644
--- a/apps/web/app/api/domains/route.ts
+++ b/apps/web/app/api/domains/route.ts
@@ -35,7 +35,9 @@ export const GET = withWorkspace(
...(includeLink && {
links: {
where: {
- key: "_root",
+ key: {
+ in: ["_root", "akoJCU0="],
+ },
},
include: {
tags: {