Skip to content
Merged
Prev Previous commit
fix(demo-request): remove region from schema and route, delete unused…
… PostGrid
  • Loading branch information
emir-karabeg committed Apr 5, 2026
commit 3af9c1b20b79346aa88de9976237813e0f09dbdd
92 changes: 0 additions & 92 deletions apps/sim/app/(landing)/blog/post-grid.tsx

This file was deleted.

25 changes: 0 additions & 25 deletions apps/sim/app/(landing)/components/demo-request/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,6 @@ import { quickValidateEmail } from '@/lib/messaging/email/validation'

const FREE_EMAIL_DOMAINS = new Set(freeEmailDomains)

export const DEMO_REQUEST_REGION_VALUES = [
'north_america',
'europe',
'asia_pacific',
'latin_america',
'middle_east_africa',
'other',
] as const

export const DEMO_REQUEST_COMPANY_SIZE_VALUES = [
'1_10',
'11_50',
Expand All @@ -24,15 +15,6 @@ export const DEMO_REQUEST_COMPANY_SIZE_VALUES = [
'10000_plus',
] as const

export const DEMO_REQUEST_REGION_OPTIONS = [
{ value: 'north_america', label: 'North America' },
{ value: 'europe', label: 'Europe' },
{ value: 'asia_pacific', label: 'Asia Pacific' },
{ value: 'latin_america', label: 'Latin America' },
{ value: 'middle_east_africa', label: 'Middle East & Africa' },
{ value: 'other', label: 'Other' },
] as const

export const DEMO_REQUEST_COMPANY_SIZE_OPTIONS = [
{ value: '1_10', label: '1–10' },
{ value: '11_50', label: '11–50' },
Expand Down Expand Up @@ -73,9 +55,6 @@ export const demoRequestSchema = z.object({
.max(50, 'Phone number must be 50 characters or less')
.optional()
.transform((value) => (value && value.length > 0 ? value : undefined)),
region: z.enum(DEMO_REQUEST_REGION_VALUES, {
errorMap: () => ({ message: 'Please select a region' }),
}),
companySize: z.enum(DEMO_REQUEST_COMPANY_SIZE_VALUES, {
errorMap: () => ({ message: 'Please select company size' }),
}),
Expand All @@ -84,10 +63,6 @@ export const demoRequestSchema = z.object({

export type DemoRequestPayload = z.infer<typeof demoRequestSchema>

export function getDemoRequestRegionLabel(value: DemoRequestPayload['region']): string {
return DEMO_REQUEST_REGION_OPTIONS.find((option) => option.value === value)?.label ?? value
}

export function getDemoRequestCompanySizeLabel(value: DemoRequestPayload['companySize']): string {
return DEMO_REQUEST_COMPANY_SIZE_OPTIONS.find((option) => option.value === value)?.label ?? value
}
5 changes: 1 addition & 4 deletions apps/sim/app/api/demo-requests/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { getFromEmailAddress } from '@/lib/messaging/email/utils'
import {
demoRequestSchema,
getDemoRequestCompanySizeLabel,
getDemoRequestRegionLabel,
} from '@/app/(landing)/components/demo-request/consts'

const logger = createLogger('DemoRequestAPI')
Expand Down Expand Up @@ -58,12 +57,11 @@ export async function POST(req: NextRequest) {
)
}

const { firstName, lastName, companyEmail, phoneNumber, region, companySize, details } =
const { firstName, lastName, companyEmail, phoneNumber, companySize, details } =
validationResult.data

logger.info(`[${requestId}] Processing demo request`, {
email: `${companyEmail.substring(0, 3)}***`,
region,
companySize,
})

Expand All @@ -72,7 +70,6 @@ Submitted: ${new Date().toISOString()}
Name: ${firstName} ${lastName}
Email: ${companyEmail}
Phone: ${phoneNumber ?? 'Not provided'}
Region: ${getDemoRequestRegionLabel(region)}
Company size: ${getDemoRequestCompanySizeLabel(companySize)}

Details:
Expand Down
Loading