]> git.immae.eu Git - github/bastienwirtz/homer.git/commitdiff
Update src/components/services/OpenWeather.vue 316/head
authorRobin Schneider <45321827+robinschneider@users.noreply.github.com>
Mon, 25 Oct 2021 12:08:31 +0000 (14:08 +0200)
committerGitHub <noreply@github.com>
Mon, 25 Oct 2021 12:08:31 +0000 (14:08 +0200)
Co-authored-by: Bastien Wirtz <bastien.wirtz@gmail.com>
src/components/services/OpenWeather.vue

index 7352b9be0ea4d540e8cb288948621eca4ee4da7b..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) {