This commit is contained in:
parent
ae499b47d1
commit
2c1cd9a844
@ -58,19 +58,19 @@ export default defineNuxtComponent({
|
|||||||
this.databaseLocations[i]['name'].includes(input.name) &&
|
this.databaseLocations[i]['name'].includes(input.name) &&
|
||||||
this.databaseLocations[i]['country'].includes(input.country)
|
this.databaseLocations[i]['country'].includes(input.country)
|
||||||
) {
|
) {
|
||||||
idx = i;
|
idx = Number(this.databaseLocations[i]['id']);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (idx > 0) {
|
if (idx > 0) {
|
||||||
if (!this.locations.includes(idx + 1)) {
|
if (!this.locations.includes(idx)) {
|
||||||
await this.addNewLocID(idx + 1);
|
await this.addNewLocID(idx);
|
||||||
await this.fetchWeatherData(false, idx + 1);
|
await this.fetchWeatherData(false, idx);
|
||||||
}
|
}
|
||||||
await $fetch(this.apiURL, {
|
await $fetch(this.apiURL, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
id: idx + 1,
|
id: idx,
|
||||||
name: 'existing',
|
name: 'existing',
|
||||||
country: '',
|
country: '',
|
||||||
longitude: 0,
|
longitude: 0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user