Skip to content

Commit

Permalink
front: make CichDictValue.ciCode a number
Browse files Browse the repository at this point in the history
This is unconditionally converted to a number later on (when turning
it into a UIC). We don't need to store this as a string.

Signed-off-by: Simon Ser <[email protected]>
  • Loading branch information
emersion committed Nov 25, 2024
1 parent 3688fa9 commit ba69de2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion front/src/applications/operationalStudies/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export type TrainScheduleImportConfig = {
};

export type CichDictValue = {
ciCode: number | string;
ciCode: number;
chCode?: string;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ const ImportTrainScheduleConfig = ({
}
const extractCiChCode = (code: string) => {
const [ciCode, chCode] = code.split('/');
return { ciCode, chCode };
return { ciCode: Number(ciCode), chCode };
};

const cleanTimeFormat = (time: string): string => time.replace(/\.0$/, ''); // Remove the '.0' if it's at the end of the time string
Expand Down

0 comments on commit ba69de2

Please sign in to comment.