diff --git a/src/components/CreateNewPostcodeForm.vue b/src/components/CreateNewPostcodeForm.vue index 6f7d8a24e..6e634465c 100644 --- a/src/components/CreateNewPostcodeForm.vue +++ b/src/components/CreateNewPostcodeForm.vue @@ -56,10 +56,10 @@ async function onCityCreated(newTown, formData) { } function setTown(newTown, data) { - if (!newTown) return; - town.value = newTown; data.provinceFk = newTown.provinceFk; data.countryFk = newTown.province.countryFk; + if (!newTown) return; + town.value = newTown; } async function setProvince(id, data) { @@ -73,7 +73,7 @@ async function onProvinceCreated(data) { await provincesFetchDataRef.value.fetch({ where: { countryFk: postcodeFormData.countryFk }, }); - postcodeFormData.provinceFk.value = data.id; + postcodeFormData.provinceFk = data.id; } watch( @@ -158,6 +158,13 @@ async function handleCountries(data) { auto-load url="Towns/location" /> +