diff --git a/.eslintrc.js b/.eslintrc.js index c8bdecb1a..1d09a896f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -58,7 +58,7 @@ module.exports = { rules: { 'prefer-promise-reject-errors': 'off', 'no-unused-vars': 'warn', - + "vue/no-multiple-template-root": "off" , // allow debugger during development only 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', }, diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index 4ad566bf8..a7e820afa 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -177,13 +177,6 @@ watch(formUrl, async () => { }); - + { - await postcodeFetchDataRef.value.fetch(); - await townsFetchDataRef.value.fetch(); - formData.postcode = code; - formData.provinceFk = provinceFk; - formData.city = citiesLocationOptions.value.find((town) => town.id === townFk).name; - formData.countryFk = countryFk; -}; + +function handleLocation(data, location ) { + const { town, code, provinceFk, countryFk } = location ?? {} + data.postcode = code; + data.city = town; + data.provinceFk = provinceFk; + data.countryFk = countryFk; +}