updated js & css
parent
26d4bf9647
commit
2d15417dfe
|
|
@ -23001,17 +23001,14 @@ __webpack_require__.r(__webpack_exports__);
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
|
||||||
if (newVal !== oldVal && newVal.length === 4 && this.form.country === 'CH') {
|
if (newVal !== oldVal && newVal.length === 4 && this.form.country === 'CH') {
|
||||||
axios.get("https://swisspost.opendatasoft.com/api/records/1.0/search/?dataset=plz_verzeichnis_v2&q=&facet=ortbez18&refine.postleitzahl=".concat(newVal)).then(function (response) {
|
axios.get("https://openplzapi.org/ch/Localities?postalCode=".concat(newVal)).then(function (response) {
|
||||||
var records = response.data.records;
|
var data = response.data;
|
||||||
|
/*if (records.length > 1) {
|
||||||
|
records = records.filter(rec => rec.geometry);
|
||||||
|
}*/
|
||||||
|
|
||||||
if (records.length > 1) {
|
if (data[0]) {
|
||||||
records = records.filter(function (rec) {
|
_this.form.city = data[0].name;
|
||||||
return rec.geometry;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (records[0]) {
|
|
||||||
_this.form.city = records[0].fields.ortbez18;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue