Skip to content

Commit 3af9c1b

Browse files
committed
fix(demo-request): remove region from schema and route, delete unused PostGrid
1 parent 2d0e30b commit 3af9c1b

File tree

3 files changed

+1
-121
lines changed

3 files changed

+1
-121
lines changed

apps/sim/app/(landing)/blog/post-grid.tsx

Lines changed: 0 additions & 92 deletions
This file was deleted.

apps/sim/app/(landing)/components/demo-request/consts.ts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,6 @@ import { quickValidateEmail } from '@/lib/messaging/email/validation'
55

66
const FREE_EMAIL_DOMAINS = new Set(freeEmailDomains)
77

8-
export const DEMO_REQUEST_REGION_VALUES = [
9-
'north_america',
10-
'europe',
11-
'asia_pacific',
12-
'latin_america',
13-
'middle_east_africa',
14-
'other',
15-
] as const
16-
178
export const DEMO_REQUEST_COMPANY_SIZE_VALUES = [
189
'1_10',
1910
'11_50',
@@ -24,15 +15,6 @@ export const DEMO_REQUEST_COMPANY_SIZE_VALUES = [
2415
'10000_plus',
2516
] as const
2617

27-
export const DEMO_REQUEST_REGION_OPTIONS = [
28-
{ value: 'north_america', label: 'North America' },
29-
{ value: 'europe', label: 'Europe' },
30-
{ value: 'asia_pacific', label: 'Asia Pacific' },
31-
{ value: 'latin_america', label: 'Latin America' },
32-
{ value: 'middle_east_africa', label: 'Middle East & Africa' },
33-
{ value: 'other', label: 'Other' },
34-
] as const
35-
3618
export const DEMO_REQUEST_COMPANY_SIZE_OPTIONS = [
3719
{ value: '1_10', label: '1–10' },
3820
{ value: '11_50', label: '11–50' },
@@ -73,9 +55,6 @@ export const demoRequestSchema = z.object({
7355
.max(50, 'Phone number must be 50 characters or less')
7456
.optional()
7557
.transform((value) => (value && value.length > 0 ? value : undefined)),
76-
region: z.enum(DEMO_REQUEST_REGION_VALUES, {
77-
errorMap: () => ({ message: 'Please select a region' }),
78-
}),
7958
companySize: z.enum(DEMO_REQUEST_COMPANY_SIZE_VALUES, {
8059
errorMap: () => ({ message: 'Please select company size' }),
8160
}),
@@ -84,10 +63,6 @@ export const demoRequestSchema = z.object({
8463

8564
export type DemoRequestPayload = z.infer<typeof demoRequestSchema>
8665

87-
export function getDemoRequestRegionLabel(value: DemoRequestPayload['region']): string {
88-
return DEMO_REQUEST_REGION_OPTIONS.find((option) => option.value === value)?.label ?? value
89-
}
90-
9166
export function getDemoRequestCompanySizeLabel(value: DemoRequestPayload['companySize']): string {
9267
return DEMO_REQUEST_COMPANY_SIZE_OPTIONS.find((option) => option.value === value)?.label ?? value
9368
}

apps/sim/app/api/demo-requests/route.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { getFromEmailAddress } from '@/lib/messaging/email/utils'
1010
import {
1111
demoRequestSchema,
1212
getDemoRequestCompanySizeLabel,
13-
getDemoRequestRegionLabel,
1413
} from '@/app/(landing)/components/demo-request/consts'
1514

1615
const logger = createLogger('DemoRequestAPI')
@@ -58,12 +57,11 @@ export async function POST(req: NextRequest) {
5857
)
5958
}
6059

61-
const { firstName, lastName, companyEmail, phoneNumber, region, companySize, details } =
60+
const { firstName, lastName, companyEmail, phoneNumber, companySize, details } =
6261
validationResult.data
6362

6463
logger.info(`[${requestId}] Processing demo request`, {
6564
email: `${companyEmail.substring(0, 3)}***`,
66-
region,
6765
companySize,
6866
})
6967

@@ -72,7 +70,6 @@ Submitted: ${new Date().toISOString()}
7270
Name: ${firstName} ${lastName}
7371
Email: ${companyEmail}
7472
Phone: ${phoneNumber ?? 'Not provided'}
75-
Region: ${getDemoRequestRegionLabel(region)}
7673
Company size: ${getDemoRequestCompanySizeLabel(companySize)}
7774
7875
Details:

0 commit comments

Comments
 (0)