The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
NON_ACTIVE → INACTIVE
Steven Tey29dbfb3a1eea
diff --git a/apps/web/app/(ee)/api/embed/referrals/links/[linkId]/route.ts b/apps/web/app/(ee)/api/embed/referrals/links/[linkId]/route.tsindex 5e660320d7..dc0205b378 100644--- a/apps/web/app/(ee)/api/embed/referrals/links/[linkId]/route.ts+++ b/apps/web/app/(ee)/api/embed/referrals/links/[linkId]/route.ts@@ -7,7 +7,7 @@ import { sendWorkspaceWebhook } from "@/lib/webhook/publish";import { linkEventSchema } from "@/lib/zod/schemas/links";import {createPartnerLinkSchema,- NON_ACTIVE_ENROLLMENT_STATUSES,+ INACTIVE_ENROLLMENT_STATUSES,} from "@/lib/zod/schemas/partners";import { ReferralsEmbedLinkSchema } from "@/lib/zod/schemas/referrals-embed";import { prisma } from "@dub/prisma";@@ -22,7 +22,7 @@ export const PATCH = withReferralsEmbedToken(.pick({ url: true, key: true }).parse(await parseRequestBody(req));- if (NON_ACTIVE_ENROLLMENT_STATUSES.includes(programEnrollment.status)) {+ if (INACTIVE_ENROLLMENT_STATUSES.includes(programEnrollment.status)) {throw new DubApiError({code: "forbidden",message: `You are ${programEnrollment.status} from this program hence cannot create links.`,diff --git a/apps/web/app/(ee)/api/partner-profile/programs/[programId]/links/route.ts b/apps/web/app/(ee)/api/partner-profile/programs/[programId]/links/route.tsindex 686bfb8069..f3ca5217a9 100644--- a/apps/web/app/(ee)/api/partner-profile/programs/[programId]/links/route.ts+++ b/apps/web/app/(ee)/api/partner-profile/programs/[programId]/links/route.ts@@ -8,7 +8,7 @@ import { withPartnerProfile } from "@/lib/auth/partner";import { PartnerProfileLinkSchema } from "@/lib/zod/schemas/partner-profile";import {createPartnerLinkSchema,- NON_ACTIVE_ENROLLMENT_STATUSES,+ INACTIVE_ENROLLMENT_STATUSES,} from "@/lib/zod/schemas/partners";import { prisma } from "@dub/prisma";import { NextResponse } from "next/server";@@ -65,7 +65,7 @@ export const POST = withPartnerProfile(},});- if (NON_ACTIVE_ENROLLMENT_STATUSES.includes(status)) {+ if (INACTIVE_ENROLLMENT_STATUSES.includes(status)) {throw new DubApiError({code: "forbidden",message: `You cannot create links in this program because you have been ${status}`,diff --git a/apps/web/lib/actions/partners/bulk-reject-partner-applications.ts b/apps/web/lib/actions/partners/bulk-reject-partner-applications.tsindex 9b0e267246..1aadb3add0 100644--- a/apps/web/lib/actions/partners/bulk-reject-partner-applications.ts+++ b/apps/web/lib/actions/partners/bulk-reject-partner-applications.ts@@ -6,7 +6,7 @@ import { resolveFraudGroups } from "@/lib/api/fraud/resolve-fraud-groups";import { getDefaultProgramIdOrThrow } from "@/lib/api/programs/get-default-program-id-or-throw";import {bulkRejectPartnersSchema,- NON_ACTIVE_ENROLLMENT_STATUSES,+ INACTIVE_ENROLLMENT_STATUSES,} from "@/lib/zod/schemas/partners";import { prisma } from "@dub/prisma";import { FraudRuleType, ProgramEnrollmentStatus } from "@prisma/client";@@ -80,7 +80,7 @@ export const bulkRejectPartnerApplicationsAction = authActionClientnot: programId,},status: {- notIn: NON_ACTIVE_ENROLLMENT_STATUSES,+ notIn: INACTIVE_ENROLLMENT_STATUSES,},},select: {diff --git a/apps/web/lib/actions/partners/reject-partner-application.ts b/apps/web/lib/actions/partners/reject-partner-application.tsindex 76911134d4..3083b175b9 100644--- a/apps/web/lib/actions/partners/reject-partner-application.ts+++ b/apps/web/lib/actions/partners/reject-partner-application.ts@@ -5,7 +5,7 @@ import { createFraudEvents } from "@/lib/api/fraud/create-fraud-events";import { resolveFraudGroups } from "@/lib/api/fraud/resolve-fraud-groups";import { getDefaultProgramIdOrThrow } from "@/lib/api/programs/get-default-program-id-or-throw";import {- NON_ACTIVE_ENROLLMENT_STATUSES,+ INACTIVE_ENROLLMENT_STATUSES,rejectPartnerSchema,} from "@/lib/zod/schemas/partners";import { prisma } from "@dub/prisma";@@ -65,7 +65,7 @@ export const rejectPartnerApplicationAction = authActionClientnot: programId,},status: {- notIn: NON_ACTIVE_ENROLLMENT_STATUSES,+ notIn: INACTIVE_ENROLLMENT_STATUSES,},},select: {diff --git a/apps/web/lib/api/fraud/detect-duplicate-payout-method-fraud.ts b/apps/web/lib/api/fraud/detect-duplicate-payout-method-fraud.tsindex eec008cea1..1b5ca7e5c8 100644--- a/apps/web/lib/api/fraud/detect-duplicate-payout-method-fraud.ts+++ b/apps/web/lib/api/fraud/detect-duplicate-payout-method-fraud.ts@@ -1,5 +1,5 @@import { CreateFraudEventInput } from "@/lib/types";-import { NON_ACTIVE_ENROLLMENT_STATUSES } from "@/lib/zod/schemas/partners";+import { INACTIVE_ENROLLMENT_STATUSES } from "@/lib/zod/schemas/partners";import { prisma } from "@dub/prisma";import { FraudRuleType, ProgramEnrollment } from "@dub/prisma/client";import { createFraudEvents } from "./create-fraud-events";@@ -54,7 +54,7 @@ export async function detectDuplicatePayoutMethodFraud(for (const [programId, partners] of partnersByProgram.entries()) {for (const sourcePartner of partners) {- if (NON_ACTIVE_ENROLLMENT_STATUSES.includes(sourcePartner.status)) {+ if (INACTIVE_ENROLLMENT_STATUSES.includes(sourcePartner.status)) {continue;}diff --git a/apps/web/lib/zod/schemas/partners.ts b/apps/web/lib/zod/schemas/partners.tsindex 239695a9b2..7bbdc50a06 100644--- a/apps/web/lib/zod/schemas/partners.ts+++ b/apps/web/lib/zod/schemas/partners.ts@@ -23,7 +23,7 @@ import { parseUrlSchema } from "./utils";export const PARTNERS_MAX_PAGE_SIZE = 100;-export const NON_ACTIVE_ENROLLMENT_STATUSES: ProgramEnrollmentStatus[] = [+export const INACTIVE_ENROLLMENT_STATUSES: ProgramEnrollmentStatus[] = ["banned","deactivated","rejected",diff --git a/apps/web/ui/partners/partner-info-cards.tsx b/apps/web/ui/partners/partner-info-cards.tsxindex 71760a28f9..4a500fab4e 100644--- a/apps/web/ui/partners/partner-info-cards.tsx+++ b/apps/web/ui/partners/partner-info-cards.tsx@@ -7,7 +7,7 @@ import {RewardProps,} from "@/lib/types";import { DEFAULT_PARTNER_GROUP } from "@/lib/zod/schemas/groups";-import { NON_ACTIVE_ENROLLMENT_STATUSES } from "@/lib/zod/schemas/partners";+import { INACTIVE_ENROLLMENT_STATUSES } from "@/lib/zod/schemas/partners";import {CalendarIcon,ChartActivity2,@@ -298,7 +298,7 @@ export function PartnerInfoCards({changeButtonText="Change"hideChangeButton={"status" in partner &&- NON_ACTIVE_ENROLLMENT_STATUSES.includes(partner.status)+ INACTIVE_ENROLLMENT_STATUSES.includes(partner.status)}className="rounded-lg bg-white shadow-sm"selectedGroupId={selectedGroupId}