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]['country'].includes(input.country)
) {
idx = i;
idx = Number(this.databaseLocations[i]['id']);
break;
}
}
if (idx > 0) {
if (!this.locations.includes(idx + 1)) {
await this.addNewLocID(idx + 1);
await this.fetchWeatherData(false, idx + 1);
if (!this.locations.includes(idx)) {
await this.addNewLocID(idx);
await this.fetchWeatherData(false, idx);
}
await $fetch(this.apiURL, {
method: 'POST',
body: JSON.stringify({
id: idx + 1,
id: idx,
name: 'existing',
country: '',
longitude: 0,