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.

temp fix hide profile

Steven Teyb069b5e1ee24
diff --git a/apps/web/app/api/partner-profile/programs/[programId]/customers/[customerId]/activity/route.ts b/apps/web/app/api/partner-profile/programs/[programId]/customers/[customerId]/activity/route.ts
index 8e625d818b..1679008588 100644
--- a/apps/web/app/api/partner-profile/programs/[programId]/customers/[customerId]/activity/route.ts
+++ b/apps/web/app/api/partner-profile/programs/[programId]/customers/[customerId]/activity/route.ts
@@ -16,6 +16,13 @@ export const GET = withPartnerProfile(async ({ partner, params }) => {
programId: programId,
});
+ if (program.slug === "framer") {
+ throw new DubApiError({
+ code: "forbidden",
+ message: "Framer program does not support customer activity",
+ });
+ }
+
const customer = await prisma.customer.findUnique({
where: {
id: customerId,
diff --git a/apps/web/app/api/partner-profile/programs/[programId]/customers/[customerId]/route.ts b/apps/web/app/api/partner-profile/programs/[programId]/customers/[customerId]/route.ts
index 8278f79f78..39b2e6ba44 100644
--- a/apps/web/app/api/partner-profile/programs/[programId]/customers/[customerId]/route.ts
+++ b/apps/web/app/api/partner-profile/programs/[programId]/customers/[customerId]/route.ts
@@ -16,6 +16,13 @@ export const GET = withPartnerProfile(async ({ partner, params }) => {
programId: programId,
});
+ if (program.slug === "framer") {
+ throw new DubApiError({
+ code: "forbidden",
+ message: "Framer program does not support customer profile",
+ });
+ }
+
const customer = await prisma.customer.findUnique({
where: {
id: customerId,
diff --git a/apps/web/app/partners.dub.co/(dashboard)/programs/[programSlug]/(enrolled)/customers/[customerId]/page.tsx b/apps/web/app/partners.dub.co/(dashboard)/programs/[programSlug]/(enrolled)/customers/[customerId]/page.tsx
index 4982498f9d..67a7a9e209 100644
--- a/apps/web/app/partners.dub.co/(dashboard)/programs/[programSlug]/(enrolled)/customers/[customerId]/page.tsx
+++ b/apps/web/app/partners.dub.co/(dashboard)/programs/[programSlug]/(enrolled)/customers/[customerId]/page.tsx
@@ -1,8 +1,16 @@
import { PageContent } from "@/ui/layout/page-content";
import { MaxWidthWrapper } from "@dub/ui";
+import { redirect } from "next/navigation";
import { ProgramCustomerPageClient } from "./page-client";
-export default function ProgramCustomer() {
+export default function ProgramCustomer({
+ params,
+}: {
+ params: { programSlug: string; customerId: string };
+}) {
+ if (params.programSlug === "framer") {
+ redirect("/programs/framer");
+ }
return (
<PageContent hideReferButton>
<MaxWidthWrapper className="flex flex-col gap-6">
diff --git a/apps/web/lib/api/links/cache.ts b/apps/web/lib/api/links/cache.ts
index f6b63dbd7f..97f73571f3 100644
--- a/apps/web/lib/api/links/cache.ts
+++ b/apps/web/lib/api/links/cache.ts
@@ -52,7 +52,8 @@ class LinkCache {
async get({ domain, key }: Pick<LinkProps, "domain" | "key">) {
// here we use linkcache:${domain}:${key} instead of this._createKey({ domain, key })
- // because the key can either be case-sensitive or case-insensitive depending on the domain
+ // because the key can either be cached as case-sensitive or case-insensitive depending on the domain
+ // so we should get the original key from the cache
return await redis.get<RedisLinkProps>(`linkcache:${domain}:${key}`);
}