From b7788512bca69fdd3565b5a011793c528fdf2fb2 Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 9 Apr 2024 08:41:44 +0200 Subject: [PATCH] refactor: refs #6973 fix requested changes --- src/components/CreateNewPostcodeForm.vue | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/CreateNewPostcodeForm.vue b/src/components/CreateNewPostcodeForm.vue index 514e564ae..02e84849c 100644 --- a/src/components/CreateNewPostcodeForm.vue +++ b/src/components/CreateNewPostcodeForm.vue @@ -35,17 +35,16 @@ const onDataSaved = (formData) => { const townObject = townsLocationOptions.value.find( ({id}) => id === formData.townFk ); - newPostcode.town = townObject ? townObject.name : undefined; + newPostcode.town = townObject?.name; const provinceObject = provincesOptions.value.find( ({id}) => id === formData.provinceFk ); - newPostcode.province = provinceObject ? provinceObject.name : undefined; + newPostcode.province = provinceObject?.name; const countryObject = countriesOptions.value.find( ({id}) => id === formData.countryFk ); - newPostcode.country = countryObject ? countryObject.country : undefined; - emit('onDataSaved', newPostcode); - + newPostcode.country = countryObject?.country; + emit('onDataSaved', newPostcode); }; const onCityCreated = async ({ name, provinceFk }, formData) => {