Compare commits
5 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
2d15417dfe | |
|
|
26d4bf9647 | |
|
|
ad10d61c04 | |
|
|
3f0ab15f56 | |
|
|
4bded4db0b |
|
|
@ -1,8 +1,11 @@
|
||||||
APP_NAME="Your SwissCar GmbH - AutoManager"
|
APP_NAME="Your SwissCar GmbH - AutoManager"
|
||||||
APP_ENV=local
|
APP_ENV=local
|
||||||
APP_KEY=
|
|
||||||
APP_DEBUG=true
|
APP_DEBUG=true
|
||||||
APP_URL=http://automngr.test
|
APP_URL=http://automngr.test
|
||||||
|
APP_PORT=80
|
||||||
|
|
||||||
|
USER_1_EMAIL=test@salloum.pm
|
||||||
|
USER_1_PW=abc123
|
||||||
|
|
||||||
LOG_CHANNEL=stack
|
LOG_CHANNEL=stack
|
||||||
LOG_LEVEL=debug
|
LOG_LEVEL=debug
|
||||||
|
|
@ -13,6 +16,7 @@ DB_PORT=3306
|
||||||
DB_DATABASE=automngr
|
DB_DATABASE=automngr
|
||||||
DB_USERNAME="sail"
|
DB_USERNAME="sail"
|
||||||
DB_PASSWORD="password"
|
DB_PASSWORD="password"
|
||||||
|
FORWARD_DB_PORT=3306
|
||||||
|
|
||||||
BROADCAST_DRIVER=log
|
BROADCAST_DRIVER=log
|
||||||
CACHE_DRIVER=file
|
CACHE_DRIVER=file
|
||||||
|
|
|
||||||
|
|
@ -36,20 +36,20 @@ class DatabaseSeeder extends Seeder
|
||||||
|
|
||||||
User::factory()->create([
|
User::factory()->create([
|
||||||
'name' => 'Nadim Salloum',
|
'name' => 'Nadim Salloum',
|
||||||
'email' => env('USER_1_EMAIL'),
|
'email' => env('USER_1_EMAIL', 'test@test.ch'),
|
||||||
'password' => bcrypt(env('USER_1_PW')),
|
'password' => bcrypt(env('USER_1_PW', 'abc123')),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
User::factory()->create([
|
User::factory()->create([
|
||||||
'name' => 'Mohamad Salloum',
|
'name' => 'Mohamad Salloum',
|
||||||
'email' => env('USER_2_EMAIL'),
|
'email' => env('USER_2_EMAIL', 'test2@test.ch'),
|
||||||
'password' => bcrypt(env('USER_2_PW')),
|
'password' => bcrypt(env('USER_2_PW', 'abc123')),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
User::factory()->create([
|
User::factory()->create([
|
||||||
'name' => 'Nadim Salloum',
|
'name' => 'Nadim Salloum',
|
||||||
'email' => env('USER_3_EMAIL'),
|
'email' => env('USER_3_EMAIL', 'test3@test.ch'),
|
||||||
'password' => bcrypt(env('USER_3_PW')),
|
'password' => bcrypt(env('USER_3_PW', 'abc123')),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
foreach ($this->getBrands() as $brandItem) {
|
foreach ($this->getBrands() as $brandItem) {
|
||||||
|
|
|
||||||
|
|
@ -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;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -91,14 +91,14 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
fetchCity(newVal, oldVal) {
|
fetchCity(newVal, oldVal) {
|
||||||
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=${newVal}`)
|
axios.get(`https://openplzapi.org/ch/Localities?postalCode=${newVal}`)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
let records = response.data.records;
|
let data = response.data;
|
||||||
if (records.length > 1) {
|
/*if (records.length > 1) {
|
||||||
records = records.filter(rec => rec.geometry);
|
records = records.filter(rec => rec.geometry);
|
||||||
}
|
}*/
|
||||||
if (records[0]) {
|
if (data[0]) {
|
||||||
this.form.city = records[0].fields.ortbez18;
|
this.form.city = data[0].name;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue