mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-20 22:16:26 +00:00
fix(tours): send a ski import's technique only when one is chosen
The classification request may clear the technique with null; the GPX import fields take it or leave it out, so the null never reaches them.
This commit is contained in:
@@ -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' };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user