Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

673 B
Raw Blame
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),
};