Skip to content

Commit

Permalink
front: fix unnecessary type casting in upsert path step
Browse files Browse the repository at this point in the history
Signed-off-by: Alice K. <[email protected]>
  • Loading branch information
Alice K. authored and Synar committed Feb 18, 2025
1 parent 3e66137 commit 34159e3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions front/src/reducers/osrdconf/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { v4 as uuidV4 } from 'uuid';

import { calculateDistanceAlongTrack } from 'applications/editor/tools/utils';
import type { ManageTrainSchedulePathProperties } from 'applications/operationalStudies/types';
import type { OperationalPointReference } from 'common/api/osrdEditoastApi';
import { pathStepMatchesOp } from 'modules/pathfinding/utils';
import type { SuggestedOP } from 'modules/trainschedule/components/ManageTrainSchedule/types';
import { addElementAtIndex } from 'utils/array';
Expand Down Expand Up @@ -95,7 +94,9 @@ export function upsertPathStep(statePathSteps: (PathStep | null)[], op: Suggeste
...newVia,
id: cleanPathSteps[stepIndex].id,
track_reference:
(cleanPathSteps[stepIndex] as OperationalPointReference).track_reference || undefined,
'track_reference' in cleanPathSteps[stepIndex]
? cleanPathSteps[stepIndex].track_reference
: undefined,
}; // We don't need to change the id of the updated via
statePathSteps[stepIndex] = newVia;
} else {
Expand Down

0 comments on commit 34159e3

Please sign in to comment.