@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user