diff --git a/app/javascript/dashboard/components-next/Contacts/ContactsForm/ContactsForm.vue b/app/javascript/dashboard/components-next/Contacts/ContactsForm/ContactsForm.vue index 9d172cdf9..3f3bffdf5 100644 --- a/app/javascript/dashboard/components-next/Contacts/ContactsForm/ContactsForm.vue +++ b/app/javascript/dashboard/components-next/Contacts/ContactsForm/ContactsForm.vue @@ -35,7 +35,7 @@ const FORM_CONFIG = { EMAIL_ADDRESS: { field: 'email' }, PHONE_NUMBER: { field: 'phoneNumber' }, CITY: { field: 'additionalAttributes.city' }, - COUNTRY: { field: 'additionalAttributes.country' }, + COUNTRY: { field: 'additionalAttributes.countryCode' }, BIO: { field: 'additionalAttributes.description' }, COMPANY_NAME: { field: 'additionalAttributes.companyName' }, }; @@ -123,7 +123,7 @@ const prepareStateBasedOnProps = () => { }; const countryOptions = computed(() => - countries.map(({ name }) => ({ label: name, value: name })) + countries.map(({ name, id }) => ({ label: name, value: id })) ); const editDetailsForm = computed(() => @@ -205,8 +205,8 @@ const getMessageType = key => { }; const handleCountrySelection = value => { - const selectedCountry = countries.find(option => option.name === value); - state.additionalAttributes.countryCode = selectedCountry?.id || ''; + const selectedCountry = countries.find(option => option.id === value); + state.additionalAttributes.country = selectedCountry?.name || ''; emit('update', state); }; @@ -242,7 +242,7 @@ defineExpose({