Skip to content

Commit 3e3048a

Browse files
authored
Use countryOptions so the form sends country codes instead of labels (#107162)
1 parent 16a4798 commit 3e3048a

File tree

1 file changed

+2
-6
lines changed
  • client/a8c-for-agencies/sections/marketplace/refer-hosting

1 file changed

+2
-6
lines changed

client/a8c-for-agencies/sections/marketplace/refer-hosting/form.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { SearchableDropdown } from '@automattic/components';
22
import { Button } from '@wordpress/components';
33
import { useTranslate } from 'i18n-calypso';
4-
import { ChangeEvent, useCallback, useMemo, useState } from 'react';
4+
import { ChangeEvent, useCallback, useState } from 'react';
55
import Form from 'calypso/a8c-for-agencies/components/form';
66
import FormField from 'calypso/a8c-for-agencies/components/form/field';
77
import FormSection from 'calypso/a8c-for-agencies/components/form/section';
@@ -123,10 +123,6 @@ export default function ReferHostingForm( {
123123

124124
const { countryOptions } = useCountriesAndStates();
125125

126-
const countries = useMemo( () => {
127-
return countryOptions.map( ( country ) => country.label );
128-
}, [ countryOptions ] );
129-
130126
const {
131127
formData,
132128
updateFormData,
@@ -237,7 +233,7 @@ export default function ReferHostingForm( {
237233
value={ formData.country }
238234
onChange={ ( value: string ) => handleInputChange( 'country', value ) }
239235
placeholder={ translate( 'Select country' ) }
240-
options={ countries.map( ( country ) => ( { value: country, label: country } ) ) }
236+
options={ countryOptions }
241237
/>
242238

243239
<TextField

0 commit comments

Comments
 (0)