vannut / statamic-weather-addon

🎏 A Statamic-Addon for the OpenWeathermap API
5 stars 0 forks source link

Fetch data in Action and CP updates #9

Closed vannut closed 2 years ago

vannut commented 2 years ago

This PR adds some logic to the CP to display and fetch the weather data from the API.

To prevent duplication I extracted the fetch into its own Action. Which is used in the Artisan Command as well in the CpController.

In the whole rewrite I also added a fetched_at value to the stored json. Closes #3 Also Closes #1

vannut commented 2 years ago

@Wibbmer would you be so kind to test this PR?

Wibbmer commented 2 years ago

New CP looks nice, seems to me it's all working as it should. Fetching and updating via CP as well as via the artisan command.

I could see it to be handy to make the time of the fetch available to the tag as well though, in case you would like to display how up to date the forecast is.

vannut commented 2 years ago

That's a good one. Let me see if I can find some time to inject it in the tag later this weekend.