Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
younesschrifi committed Jan 8, 2024
1 parent 3b6e758 commit f0dcdd4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 20 deletions.
15 changes: 1 addition & 14 deletions editoast/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6067,20 +6067,7 @@ paths:
content:
application/json:
schema:
properties:
path_id:
description: The ID of the path that was used to project the train path
format: int64
nullable: true
type: integer
train_ids:
items:
format: int64
type: integer
type: array
required:
- train_ids
type: object
$ref: '#/components/schemas/TrainScheduleResults'
required: true
responses:
'200':
Expand Down
2 changes: 1 addition & 1 deletion editoast/src/views/train_schedule/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ struct TrainScheduleResults {
/// Retrieve the simulation result of multiple train schedules
#[utoipa::path(
tag = "train_schedule",
request_body = inline(TrainScheduleResults),
request_body = TrainScheduleResults,
responses(
(status = 200, description = "The train schedule results", body = Vec<SimulationReport>)
)
Expand Down
14 changes: 9 additions & 5 deletions front/src/common/api/osrdEditoastApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,10 @@ const injectedRtkApi = api
GetTrainScheduleResultsApiResponse,
GetTrainScheduleResultsApiArg
>({
query: (queryArg) => ({ url: `/train_schedule/results/`, body: queryArg.body }),
query: (queryArg) => ({
url: `/train_schedule/results/`,
body: queryArg.trainScheduleResults,
}),
providesTags: ['train_schedule'],
}),
postTrainScheduleStandaloneSimulation: build.mutation<
Expand Down Expand Up @@ -1271,10 +1274,7 @@ export type PatchTrainScheduleApiArg = {
export type GetTrainScheduleResultsApiResponse =
/** status 200 The train schedule results */ SimulationReport[];
export type GetTrainScheduleResultsApiArg = {
body: {
path_id?: number | null;
train_ids: number[];
};
trainScheduleResults: TrainScheduleResults;
};
export type PostTrainScheduleStandaloneSimulationApiResponse =
/** status 200 The ids of the train_schedules created */ number[];
Expand Down Expand Up @@ -2337,6 +2337,10 @@ export type TrainSchedulePatch = {
speed_limit_tags?: string | null;
train_name?: string | null;
};
export type TrainScheduleResults = {
path_id?: number | null;
train_ids: number[];
};
export type TrainScheduleBatchItem = {
allowances?: Allowance[];
comfort?: RollingStockComfortType;
Expand Down

0 comments on commit f0dcdd4

Please sign in to comment.