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.

fix(tours): send a ski import's technique only when one is chosen

Maurice20bd384febf6
diff --git a/client/src/components/Tours/gpxImportChoices.ts b/client/src/components/Tours/gpxImportChoices.ts
index d69e965ac..5ddfac506 100644
--- a/client/src/components/Tours/gpxImportChoices.ts
+++ b/client/src/components/Tours/gpxImportChoices.ts
@@ -61,7 +61,11 @@ export function importFields(chosen: GpxImportChoices): TourGpxImportFields {
if (type === 'horse') return { tour_type: 'horse' };
// SKI-02: a ski track comes in with its discipline and, for cross-country, its technique, and no time.
const ski = type === 'ski' ? skiFieldsOf(chosen.ski) : null;
- if (ski) return { tour_type: 'ski', ...ski };
+ if (ski) {
+ // The classification request may clear a technique with null; an import only ever names one or none.
+ const { ski_discipline, ski_technique } = ski;
+ return ski_technique ? { tour_type: 'ski', ski_discipline, ski_technique } : { tour_type: 'ski', ski_discipline };
+ }
return { tour_type: 'hike' };
}