]> git.immae.eu Git - github/bastienwirtz/homer.git/blobdiff - src/components/services/OpenWeather.vue
Merge pull request #393 from jamesmacwhite/ping-endpoint-urls
[github/bastienwirtz/homer.git] / src / components / services / OpenWeather.vue
index 09ff76a3d07e04ec9c015fba6d727b5b3042af9a..79d5e37d67eb981e1420d487a9fe9c4cd1c480fd 100644 (file)
@@ -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) {