The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Keep staging programs out of the marketplace
Kiran K04f66c1cedb1
diff --git a/apps/web/app/(ee)/api/network/programs/route.ts b/apps/web/app/(ee)/api/network/programs/route.tsindex e162b17e11..73fc203257 100644--- a/apps/web/app/(ee)/api/network/programs/route.ts+++ b/apps/web/app/(ee)/api/network/programs/route.ts@@ -5,6 +5,7 @@ import {NetworkProgramSchema,getNetworkProgramsQuerySchema,} from "@/lib/zod/schemas/program-network";+import { WorkspaceEnvironment } from "@prisma/client";import { NextResponse } from "next/server";import * as z from "zod/v4";@@ -24,6 +25,7 @@ export const GET = withPartnerProfile(async ({ partner, searchParams }) => {const programs = await prisma.program.findMany({where: {+ environment: WorkspaceEnvironment.production,// Added to marketplaceaddedToMarketplaceAt: {not: null,diff --git a/apps/web/app/(ee)/partners.dub.co/(apply)/[programSlug]/(default)/apply/page.tsx b/apps/web/app/(ee)/partners.dub.co/(apply)/[programSlug]/(default)/apply/page.tsxindex ddced8ee4a..44721218a9 100644--- a/apps/web/app/(ee)/partners.dub.co/(apply)/[programSlug]/(default)/apply/page.tsx+++ b/apps/web/app/(ee)/partners.dub.co/(apply)/[programSlug]/(default)/apply/page.tsx@@ -32,11 +32,16 @@ export default async function ApplicationPage(props: {!program.group.applicationFormPublishedAt) {// for the default group:- // - if the program is featured on the marketplace (and not deactivated), redirect to the marketplace program page+ // - if the program is a production program featured on the marketplace (and not deactivated), redirect to the marketplace program page// - otherwise, throw 404// for other groups: redirect to the default group variantif (partnerGroupSlug === DEFAULT_PARTNER_GROUP.slug) {- if (program && program.addedToMarketplaceAt && !program.deactivatedAt) {+ if (+ program &&+ program.addedToMarketplaceAt &&+ !program.deactivatedAt &&+ isProductionEnvironment(program.environment)+ ) {redirect(`/marketplace/${programSlug}`);}notFound();diff --git a/apps/web/app/(ee)/partners.dub.co/(apply)/[programSlug]/(default)/apply/success/page.tsx b/apps/web/app/(ee)/partners.dub.co/(apply)/[programSlug]/(default)/apply/success/page.tsxindex ea23e51327..765f5598ff 100644--- a/apps/web/app/(ee)/partners.dub.co/(apply)/[programSlug]/(default)/apply/success/page.tsx+++ b/apps/web/app/(ee)/partners.dub.co/(apply)/[programSlug]/(default)/apply/success/page.tsx@@ -70,11 +70,16 @@ export default async function SuccessPage(props: {!program.group.applicationFormPublishedAt) {// for the default group:- // - if the program is featured on the marketplace (and not deactivated), redirect to the marketplace program page+ // - if the program is a production program featured on the marketplace (and not deactivated), redirect to the marketplace program page// - otherwise, throw 404// for other groups: redirect to the default group variantif (partnerGroupSlug === DEFAULT_PARTNER_GROUP.slug) {- if (program && program.addedToMarketplaceAt && !program.deactivatedAt) {+ if (+ program &&+ program.addedToMarketplaceAt &&+ !program.deactivatedAt &&+ isProductionEnvironment(program.environment)+ ) {redirect(`/marketplace/${programSlug}`);}notFound();diff --git a/apps/web/app/(ee)/partners.dub.co/(apply)/[programSlug]/(default)/page.tsx b/apps/web/app/(ee)/partners.dub.co/(apply)/[programSlug]/(default)/page.tsxindex 8765cc73e9..cfd598973f 100644--- a/apps/web/app/(ee)/partners.dub.co/(apply)/[programSlug]/(default)/page.tsx+++ b/apps/web/app/(ee)/partners.dub.co/(apply)/[programSlug]/(default)/page.tsx@@ -31,11 +31,16 @@ export default async function ApplyPage(props: {!program.group.landerPublishedAt) {// for the default group:- // - if the program is featured on the marketplace (and not deactivated), redirect to the marketplace program page+ // - if the program is a production program featured on the marketplace (and not deactivated), redirect to the marketplace program page// - otherwise, throw 404// for other groups: redirect to the default group variantif (partnerGroupSlug === DEFAULT_PARTNER_GROUP.slug) {- if (program && program.addedToMarketplaceAt && !program.deactivatedAt) {+ if (+ program &&+ program.addedToMarketplaceAt &&+ !program.deactivatedAt &&+ isProductionEnvironment(program.environment)+ ) {redirect(`/marketplace/${programSlug}`);}notFound();