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.

639 B
Raw Blame
import type { TourTrailGradeRequest, TourTrailGradeResponse } from '@trek/shared';
import { tourTrailGradeApi } from '../api/tourTrailGrade';
import { requireOnline } from './onlineOnly';

/**
 * BIK-05, online only: the grades come from OpenStreetMap through the server,
 * and the server keeps them a day; the client keeps nothing. Offline the card
 * says so.
 */
export const tourTrailGradeRepo = {
  async grades(
    tripId: number | string,
    body: TourTrailGradeRequest,
    signal?: AbortSignal
  ): Promise<TourTrailGradeResponse> {
    requireOnline();
    return await tourTrailGradeApi.grades(tripId, body, signal);
  },
};