fix countrySelection multiselect with fetch async countries

edit context: display country for existing address
new context: repair editPane, load countries

note: adding id for country and postcode in address endpoint json
This commit is contained in:
2021-09-20 13:27:03 +02:00
parent 3f3dd83132
commit e13b7bf195
3 changed files with 10 additions and 5 deletions

View File

@@ -381,10 +381,12 @@ export default {
if (this.flag.suggestPane === true) {
this.closeSuggestPane();
}
this.initForm();
this.getCountries();
this.flag.editPane = true;
if (this.flag.showPane === true) {
this.closeShowPane();
}
console.log('step2: open the Edit panel');
this.initForm();
this.getCountries(); // will open edit pane when resolve promise
}
},
closeEditPane() {
@@ -456,10 +458,11 @@ export default {
getCountries() {
this.flag.loading = true;
console.log('## GO');
fetchCountries().then(
countries => new Promise((resolve, reject) => {
this.entity.loaded.countries = countries.results;
this.flag.showPane = false;
console.log('## COMPLETE !');
this.flag.editPane = true;
this.flag.loading = false;
resolve()