From 8a6a21d80ccea9c32a5e3ae2117ae5308b8c81e2 Mon Sep 17 00:00:00 2001 From: Argiris Deligiannidis Date: Mon, 15 Apr 2024 02:26:34 +0300 Subject: [PATCH] PK index fixes --- components/WeatherDashboard.vue | 5 ++--- components/WeatherModals/AddLocation.vue | 11 +---------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/components/WeatherDashboard.vue b/components/WeatherDashboard.vue index 8f0ab4f..553603f 100644 --- a/components/WeatherDashboard.vue +++ b/components/WeatherDashboard.vue @@ -25,6 +25,7 @@ export default defineNuxtComponent({ locID: null, locations: [], databaseLocations: [], + weatherData: [], weatherIcons: { 1: [0], @@ -90,9 +91,7 @@ export default defineNuxtComponent({ }, /** - * Calls the API to fetch weather data for the specified location. - * a bulk parameter can be passed to fetch weather data for a list oflocations - * or a single location. + * A description of the entire function. * * @param {type} bulk - description of parameter * @param {type} location - description of parameter diff --git a/components/WeatherModals/AddLocation.vue b/components/WeatherModals/AddLocation.vue index e3235b3..5b1b392 100644 --- a/components/WeatherModals/AddLocation.vue +++ b/components/WeatherModals/AddLocation.vue @@ -48,13 +48,6 @@ export default defineNuxtComponent({ getWeatherIcon(wmoCode) { return utils.getWeatherIcon(wmoCode); }, - /** - * Adds a new location based on the input provided. - * if the location already exists in the database, it will not be added. - * - * - * @param {Object} input - The input object containing location details. - */ async addLocation(input) { this.apiURL = `${this.apiBaseURL}/locations`; if (input) { @@ -74,7 +67,6 @@ export default defineNuxtComponent({ await this.addNewLocID(idx + 1); await this.fetchWeatherData(false, idx + 1); } - await $fetch(this.apiURL, { method: 'POST', body: JSON.stringify({ @@ -108,6 +100,7 @@ export default defineNuxtComponent({ await this.addNewLocID(idx + 1); await this.fetchWeatherData(false, idx + 1); this.displayNotification('add', input); + this.closeModal('add'); } } @@ -116,9 +109,7 @@ export default defineNuxtComponent({ this.apiURL = ''; if (this.searchInput.length > 1) { this.locationData = []; - this.apiURL = this.apiBaseURL + '/location/search?query=' + this.searchInput; - console.log(this.apiURL); await fetch(this.apiURL) .then((res) => res.json()) .then((json) => {