X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2Fcomponents%2Fservices%2FOpenWeather.vue;h=79d5e37d67eb981e1420d487a9fe9c4cd1c480fd;hb=a1a70d4a3c6a8314dd2ad35344d440e4ba8e86e8;hp=7352b9be0ea4d540e8cb288948621eca4ee4da7b;hpb=487f954a3688f31d5bcc5ba614cde4da3d5deedb;p=github%2Fbastienwirtz%2Fhomer.git diff --git a/src/components/services/OpenWeather.vue b/src/components/services/OpenWeather.vue index 7352b9b..79d5e37 100644 --- a/src/components/services/OpenWeather.vue +++ b/src/components/services/OpenWeather.vue @@ -64,7 +64,8 @@ export default { locationQuery = `q=${this.item.location}`; } - const url = `https://api.openweathermap.org/data/2.5/weather?${locationQuery}&appid=${this.item.apikey}&units=${this.item.units}`; + const apiKey = this.item.apikey || this.item.apiKey; + const url = `https://api.openweathermap.org/data/2.5/weather?${locationQuery}&appid=${apiKey}&units=${this.item.units}`; fetch(url) .then((response) => { if (!response.ok) {