Skip to content

Commit 379f302

Browse files
committed
fix: import Weather type and ensure getWeather function returns typed response
1 parent 93e2682 commit 379f302

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/screens/Weather/api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import S from '@utils/storage'
2+
import { Weather } from './types'
23

34
// export const ACCUWEATHER_API_KEY = 'FqLdDZQkQofVcwsdCHX7uKdPVgWcPGHI'
45
// export const ACCUWEATHER_API_KEY = 'C42OAAd8AANIyi8SLoqvq3mm59vADvRA'
@@ -101,8 +102,7 @@ export async function getLocation(lat: number, lon: number) {
101102

102103
export async function getWeather(lat: number, lon: number) {
103104
console.log('Fetching weather for:', lat, lon)
104-
return await (await fetch(weatherUrl(lat, lon, OPENWEATHER_API_KEY))).json()
105-
// return demoWeather as Weather
105+
return await (await fetch(weatherUrl(lat, lon, OPENWEATHER_API_KEY))).json() as Weather
106106
}
107107

108108
export async function getAQI(lat: number, lon: number) {

0 commit comments

Comments
 (0)