Skip to content

Commit

Permalink
climbing: Fix bolt codes (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
jvaclavik authored Feb 18, 2024
1 parent ca41670 commit a632852
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/FeaturePanel/Climbing/useGetHandleSave.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ import { FeatureTags } from '../../../services/types';
import { useFeatureContext } from '../../utils/FeatureContext';
import { useClimbingContext } from './contexts/ClimbingContext';
import { Change, editCrag } from '../../../services/osmApiAuth';
import { boltCodeMap } from './utils/boltCodes';
import { invertedBoltCodeMap } from './utils/boltCodes';

const getPathString = (path) =>
path.length === 0
? undefined // TODO if there was empty key='', we will delete it, even though we shouldn't
: path
?.map(({ x, y, type }) => `${x},${y}${type ? boltCodeMap[type] : ''}`)
?.map(
({ x, y, type }) =>
`${x},${y}${type ? invertedBoltCodeMap[type] : ''}`,
)
.join('|');

const getUpdatedTags = (route: ClimbingRoute) => {
Expand Down

0 comments on commit a632852

Please sign in to comment.