Forecast fixes

This commit is contained in:
2026-06-24 19:18:35 -04:00
parent fdb752073f
commit 82c10d9278
8 changed files with 34 additions and 113 deletions

View File

@@ -16,5 +16,9 @@ export const api = {
position: (fields?: string) => get<{latitude: number, longitude: number, altitude: number}>('/api/position', fields ? { fields } : {}),
current: (fields?: string) => get<DataRow>('/api/current', fields ? { fields } : {}),
hourly: (start?: string, end?: string, fields?: string) => get<DataRow[]>('/api/hourly', { ...(start ? { start } : {}), ...(end ? { end } : {}), ...(fields ? { fields } : {}) }),
daily: (start?: string, end?: string, fields?: string) => get<DataRow[]>('/api/daily', { ...(start ? { start } : {}), ...(end ? { end } : {}), ...(fields ? { fields } : {}) }),
daily: (start?: Date, end?: Date, fields?: string) => get<DataRow[]>('/api/daily', {
...(start ? { start: start.toISOString().slice(0, 10) } : {}),
...(end ? { end: end.toISOString().slice(0, 10) } : {}),
...(fields ? { fields } : {})
}),
}