@@ -19,13 +19,10 @@ type ValueType = {
1919 name : string ;
2020 email : string ;
2121 company : string ;
22- databaseUsers : string ;
2322 message : string ;
2423 website ?: string ; // Honeypot field
2524} ;
2625
27- const DATABASE_USERS_OPTIONS = [ '1-10' , '11-50' , '51-200' , '200+' ] ;
28-
2926const validationSchema = yup . object ( ) . shape ( {
3027 name : yup . string ( ) . trim ( ) . required ( 'Name is a required field' ) ,
3128 email : yup
@@ -34,7 +31,6 @@ const validationSchema = yup.object().shape({
3431 . email ( 'Please provide a valid email' )
3532 . required ( 'Work email is a required field' ) ,
3633 company : yup . string ( ) . trim ( ) . required ( 'Company name is a required field' ) ,
37- databaseUsers : yup . string ( ) . trim ( ) . required ( 'Please select the number of database users' ) ,
3834 message : yup . string ( ) . trim ( ) . required ( 'Please tell us how we can help' ) ,
3935 website : yup . string ( ) . trim ( ) . optional ( ) ,
4036} ) ;
@@ -79,7 +75,7 @@ const ContactForm = ({ className, redirectURL }: { className: string; redirectUR
7975 } = useForm < ValueType > ( { resolver : yupResolver ( validationSchema ) } ) ;
8076
8177 const onSubmit = async ( values : ValueType ) => {
82- const { name, email, company, databaseUsers , message, website } = values ;
78+ const { name, email, company, message, website } = values ;
8379
8480 // Honeypot check - if filled, it's a bot
8581 if ( website ?. trim ( ) ) {
@@ -99,7 +95,7 @@ const ContactForm = ({ className, redirectURL }: { className: string; redirectUR
9995 await fetchWithRetry ( '/api/contact' , {
10096 method : 'POST' ,
10197 headers : { 'Content-Type' : 'application/json' } ,
102- body : JSON . stringify ( { name, email, company, databaseUsers , message } ) ,
98+ body : JSON . stringify ( { name, email, company, message } ) ,
10399 } ) ;
104100
105101 setButtonState ( STATES . SUCCESS ) ;
@@ -144,22 +140,6 @@ const ContactForm = ({ className, redirectURL }: { className: string; redirectUR
144140 error = { errors ?. company ?. message }
145141 { ...register ( 'company' ) }
146142 />
147- < Field
148- className = "col-span-full"
149- tag = "select"
150- error = { errors ?. databaseUsers ?. message }
151- defaultValue = ""
152- { ...register ( 'databaseUsers' ) }
153- >
154- < option value = "" disabled >
155- Database Users*
156- </ option >
157- { DATABASE_USERS_OPTIONS . map ( ( option ) => (
158- < option key = { option } value = { option } >
159- { option }
160- </ option >
161- ) ) }
162- </ Field >
163143 < Field
164144 className = "col-span-full"
165145 inputClassName = "p-4 pt-3 md:pt-2"
0 commit comments