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.

Remove the hardcoded submitted leads program list

Rafie5b5aed17f4e
diff --git a/apps/web/lib/submitted-leads/constants.ts b/apps/web/lib/submitted-leads/constants.ts
index e35e6231cc..2f2e786d5a 100644
--- a/apps/web/lib/submitted-leads/constants.ts
+++ b/apps/web/lib/submitted-leads/constants.ts
@@ -1,6 +1,5 @@
import { ActivityLogAction } from "@/lib/types";
import { textFieldSchema } from "@/lib/zod/schemas/submitted-lead-form";
-import { ACME_PROGRAM_ID } from "@dub/utils";
import { SubmittedLeadStatus } from "@prisma/client";
import * as z from "zod/v4";
@@ -46,15 +45,6 @@ export const SUBMITTED_LEAD_FORM_FIELD_INPUT_PROPS: Record<
company: { autoComplete: "organization" },
};
-export const SUBMITTED_LEADS_ENABLED_PROGRAM_IDS = [
- ACME_PROGRAM_ID, // Acme
- "prog_1K7Y2RGFC4BKZQQZAZEEK9MVE", // SelectCode
- "prog_1KFZQJZRDRV62C037FQZSY0Y8", // FFG
- "prog_1K57RA7GVBT9V3S7HRWSV4ADA", // Truss
- "prog_1KH1SFVYG79SV5JQJQRDJH56V", // Brightwave
- "prog_1M1FDRSBGY02MKBJZ5W35GCZ8", // Affilial
-];
-
export const SUBMITTED_LEAD_STATUS_TO_ACTIVITY_ACTION: Record<
SubmittedLeadStatus,
ActivityLogAction
diff --git a/apps/web/scripts/lead-form-sample.json b/apps/web/scripts/lead-form-sample.json
deleted file mode 100644
index 5e64f42328..0000000000
--- a/apps/web/scripts/lead-form-sample.json
+++ /dev/null
@@ -1,107 +0,0 @@
-{
- "fields": [
- {
- "key": "department",
- "label": "Department",
- "type": "text",
- "required": true,
- "locked": false,
- "position": 0,
- "constraints": {
- "maxLength": 100,
- "pattern": "^[a-zA-Z0-9\\s-]+$"
- }
- },
- {
- "key": "description",
- "label": "Description",
- "type": "textarea",
- "required": true,
- "locked": false,
- "position": 1,
- "constraints": {
- "maxLength": 500
- }
- },
- {
- "key": "referralType",
- "label": "Referral Type",
- "type": "select",
- "required": true,
- "locked": false,
- "position": 2,
- "options": [
- {
- "label": "Enterprise",
- "value": "enterprise"
- },
- {
- "label": "SMB",
- "value": "smb"
- },
- {
- "label": "Startup",
- "value": "startup"
- }
- ]
- },
- {
- "key": "country",
- "label": "Country",
- "type": "country",
- "required": false,
- "locked": false,
- "position": 3
- },
- {
- "key": "startDate",
- "label": "Start Date",
- "type": "date",
- "required": false,
- "locked": false,
- "position": 4
- },
- {
- "key": "interests",
- "label": "Interests",
- "type": "multiSelect",
- "required": false,
- "locked": false,
- "position": 5,
- "options": [
- {
- "label": "Technology",
- "value": "technology"
- },
- {
- "label": "Marketing",
- "value": "marketing"
- },
- {
- "label": "Sales",
- "value": "sales"
- },
- {
- "label": "Support",
- "value": "support"
- }
- ]
- },
- {
- "key": "employeeCount",
- "label": "Employee Count",
- "type": "number",
- "required": false,
- "locked": false,
- "position": 6
- },
- {
- "key": "phoneNumber",
- "label": "Phone Number",
- "type": "phone",
- "required": false,
- "locked": false,
- "position": 7
- }
- ]
-}
diff --git a/apps/web/scripts/update-lead-form-data.ts b/apps/web/scripts/update-lead-form-data.ts
deleted file mode 100644
index c997cc83a8..0000000000
--- a/apps/web/scripts/update-lead-form-data.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-import { prisma } from "@/lib/prisma";
-import { submittedLeadFormSchema } from "@/lib/zod/schemas/submitted-lead-form";
-import { ACME_PROGRAM_ID } from "@dub/utils";
-import "dotenv-flow/config";
-import { readFileSync } from "fs";
-
-async function main() {
- const programId = ACME_PROGRAM_ID;
- const jsonFilePath = "./scripts/lead-form-sample.json";
-
- // Read and parse JSON file
- let formData;
- try {
- const fileContent = readFileSync(jsonFilePath, "utf-8");
- formData = JSON.parse(fileContent);
- } catch (error) {
- console.error(`Error reading JSON file: ${error}`);
- process.exit(1);
- }
-
- // Validate JSON against schema
- let validatedData;
- try {
- validatedData = submittedLeadFormSchema.parse(formData);
- } catch (error) {
- console.error("Validation failed:", error);
- process.exit(1);
- }
-
- await prisma.program.update({
- where: {
- id: programId,
- },
- data: {
- referralFormData: validatedData,
- },
- });
-}
-
-main();