Fix apikey for Weather Forecast

Hopefully adding in the ability to read APIkey from env var
This commit is contained in:
dintho 2025-03-10 18:06:59 -06:00 committed by GitHub
parent befa9a5c25
commit bd505286e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -56,7 +56,8 @@ export default {
return this.options.numDays || 6;
},
endpoint() {
const { apiKey, city } = this.options;
const apiKey = this.parseAsEnvVar(this.options.apiKey);
const city = this.options;
const params = `?q=${city}&cnt=${this.numDays}&units=${this.units}&appid=${apiKey}`;
return `${widgetApiEndpoints.weatherForecast}${params}`;
},