PK index fixes
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Argiris Deligiannidis 2024-04-15 09:25:43 +03:00
parent ae499b47d1
commit 2c1cd9a844

View File

@ -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,