feat(weather): implement provider in weather api endpoints

This commit is contained in:
2026-06-25 19:19:21 +03:00
parent d82fc4ea46
commit 5333690c47
6 changed files with 31 additions and 19 deletions
View File
+13
View File
@@ -0,0 +1,13 @@
from typing import Annotated
from fastapi import Depends
from gallery.easel.core import AppRequest
from gallery.sketch.weather.api import WeatherApi
async def get_weather_api(request: AppRequest, provider: str | None = None) -> WeatherApi:
return request.app.state.api.get_weather(provider)
WeatherApiDepends = Annotated[WeatherApi, Depends(get_weather_api)]