forked from verdnatura/salix-front
refactor: refs #6973 fix requested changes
This commit is contained in:
parent
3bededcd94
commit
b7788512bc
|
@ -35,17 +35,16 @@ const onDataSaved = (formData) => {
|
||||||
const townObject = townsLocationOptions.value.find(
|
const townObject = townsLocationOptions.value.find(
|
||||||
({id}) => id === formData.townFk
|
({id}) => id === formData.townFk
|
||||||
);
|
);
|
||||||
newPostcode.town = townObject ? townObject.name : undefined;
|
newPostcode.town = townObject?.name;
|
||||||
const provinceObject = provincesOptions.value.find(
|
const provinceObject = provincesOptions.value.find(
|
||||||
({id}) => id === formData.provinceFk
|
({id}) => id === formData.provinceFk
|
||||||
);
|
);
|
||||||
newPostcode.province = provinceObject ? provinceObject.name : undefined;
|
newPostcode.province = provinceObject?.name;
|
||||||
const countryObject = countriesOptions.value.find(
|
const countryObject = countriesOptions.value.find(
|
||||||
({id}) => id === formData.countryFk
|
({id}) => id === formData.countryFk
|
||||||
);
|
);
|
||||||
newPostcode.country = countryObject ? countryObject.country : undefined;
|
newPostcode.country = countryObject?.country;
|
||||||
emit('onDataSaved', newPostcode);
|
emit('onDataSaved', newPostcode);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const onCityCreated = async ({ name, provinceFk }, formData) => {
|
const onCityCreated = async ({ name, provinceFk }, formData) => {
|
||||||
|
|
Loading…
Reference in New Issue