Add TimeToLeave feature checklist and plan (50)
Add TimeToLeave feature checklist and plan
This commit is contained in:
@@ -56,6 +56,23 @@ export class ApiClient {
|
||||
return res.json();
|
||||
}
|
||||
|
||||
async getWalkRoute(
|
||||
fromLat: number,
|
||||
fromLng: number,
|
||||
toLat: number,
|
||||
toLng: number,
|
||||
): Promise<BikeRoute> {
|
||||
const url = buildUrl(this.baseUrl, "/api/walk-route", {
|
||||
fromLat: String(fromLat),
|
||||
fromLng: String(fromLng),
|
||||
toLat: String(toLat),
|
||||
toLng: String(toLng),
|
||||
});
|
||||
const res = await fetch(url);
|
||||
if (!res.ok) throw new Error(`Walk route failed: ${res.status}`);
|
||||
return res.json();
|
||||
}
|
||||
|
||||
async fetchCalendar(url: string, days?: number): Promise<CalendarEvent[]> {
|
||||
const params: Record<string, string> = { url };
|
||||
if (days) params.days = String(days);
|
||||
|
||||
Reference in New Issue
Block a user