mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-22 06:56:35 +00:00
73237ffedb
The tour type is a dropdown; a bike tour picks its profile, routes for it, says when a point lies off every way, and shows what it runs on: surfaces, kinds of way and, for a mountain bike, the trail grades, each pointed at on the map. A type's own map (OpenHikingMap for a hike, CyclOSM for a bike tour) is offered while a tour of that type is open, with an admin switch each. From the planned cards: a hike avoids steep climbs, steps or ferries, nothing else; a saved tour can be shared where the platform takes GPX files; and the tours rail adds a tour from one menu: plan new, import GPX, or take one over from another trip.
21 lines
673 B
TypeScript
21 lines
673 B
TypeScript
import type { TourTrailGradeRequest, TourTrailGradeResponse } from '@trek/shared';
|
|
import apiClient from './client';
|
|
|
|
/**
|
|
* BIK-05: the trail grades of the ways a mountain bike tour runs on. The
|
|
* server asks Overpass in parts, one after another, so a long tour may take
|
|
* longer than the shared default.
|
|
*/
|
|
const TRAIL_GRADE_TIMEOUT_MS = 60_000;
|
|
|
|
export const tourTrailGradeApi = {
|
|
grades: (
|
|
tripId: number | string,
|
|
body: TourTrailGradeRequest,
|
|
signal?: AbortSignal
|
|
): Promise<TourTrailGradeResponse> =>
|
|
apiClient
|
|
.post(`/trips/${tripId}/tours/trail-grades`, body, { signal, timeout: TRAIL_GRADE_TIMEOUT_MS })
|
|
.then((r) => r.data),
|
|
};
|