updated js & css
parent
26d4bf9647
commit
2d15417dfe
|
|
@ -23001,17 +23001,14 @@ __webpack_require__.r(__webpack_exports__);
|
|||
var _this = this;
|
||||
|
||||
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) {
|
||||
var records = response.data.records;
|
||||
axios.get("https://openplzapi.org/ch/Localities?postalCode=".concat(newVal)).then(function (response) {
|
||||
var data = response.data;
|
||||
/*if (records.length > 1) {
|
||||
records = records.filter(rec => rec.geometry);
|
||||
}*/
|
||||
|
||||
if (records.length > 1) {
|
||||
records = records.filter(function (rec) {
|
||||
return rec.geometry;
|
||||
});
|
||||
}
|
||||
|
||||
if (records[0]) {
|
||||
_this.form.city = records[0].fields.ortbez18;
|
||||
if (data[0]) {
|
||||
_this.form.city = data[0].name;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue