Skip to content

Commit

Permalink
fixup: fixing emersion's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sim51 committed Oct 21, 2024
1 parent 10fbfa2 commit 9709bec
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
CREATE TABLE IF NOT EXISTS macro_node (
id int8 PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
scenario_id int8 NOT NULL,
position_x float8 NOT NULL,
position_y float8 NOT NULL,
position_x float8 NOT NULL,
position_y float8 NOT NULL,
full_name varchar(255),
connection_time int8 NOT NULL DEFAULT 0,
labels text[] NOT NULL,
labels text[] NOT NULL,
trigram varchar(25),
path_item_key varchar(255) NOT NULL,
UNIQUE (scenario_id, path_item_key) ,
UNIQUE (scenario_id, path_item_key),
CONSTRAINT fk_scenario
FOREIGN KEY(scenario_id)
REFERENCES scenario(id)
Expand Down
5 changes: 0 additions & 5 deletions editoast/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1867,7 +1867,6 @@ paths:
get:
tags:
- scenarios
- nge
summary: Get macro node list by scneario id
parameters:
- name: project_id
Expand Down Expand Up @@ -1922,7 +1921,6 @@ paths:
post:
tags:
- scenarios
- nge
parameters:
- name: project_id
in: path
Expand Down Expand Up @@ -1960,7 +1958,6 @@ paths:
get:
tags:
- scenarios
- nge
parameters:
- name: project_id
in: path
Expand Down Expand Up @@ -2003,7 +2000,6 @@ paths:
put:
tags:
- scenarios
- nge
parameters:
- name: project_id
in: path
Expand Down Expand Up @@ -2052,7 +2048,6 @@ paths:
delete:
tags:
- scenarios
- ngraph
parameters:
- name: project_id
in: path
Expand Down
10 changes: 5 additions & 5 deletions editoast/src/views/scenario/macro_nodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ pub struct MacroNodeListResponse {
/// Get macro node list by scneario id
#[utoipa::path(
get, path = "",
tag = "scenarios, nge",
tag = "scenarios",
params(ProjectIdParam, StudyIdParam, ScenarioIdParam, PaginationQueryParam),
responses(
(status = 200, body = MacroNodeListResponse, description = "List of macro nodes for the requested scenario"),
Expand Down Expand Up @@ -164,7 +164,7 @@ async fn list(

#[utoipa::path(
post, path = "",
tag = "scenarios, nge",
tag = "scenarios",
request_body = MacroNodeForm,
params(ProjectIdParam, StudyIdParam, ScenarioIdParam),
responses(
Expand Down Expand Up @@ -222,7 +222,7 @@ async fn create(

#[utoipa::path(
get, path = "",
tag = "scenarios, nge",
tag = "scenarios",
params(ProjectIdParam, StudyIdParam, ScenarioIdParam, MacroNodeIdParam),
responses(
(status = 200, body = MacroNodeResponse, description = "The requested Macro node"),
Expand Down Expand Up @@ -259,7 +259,7 @@ async fn get(

#[utoipa::path(
put, path = "",
tag = "scenarios, nge",
tag = "scenarios",
params(ProjectIdParam, StudyIdParam, ScenarioIdParam, MacroNodeIdParam),
request_body = MacroNodeForm,
responses(
Expand Down Expand Up @@ -326,7 +326,7 @@ async fn update(

#[utoipa::path(
delete, path = "",
tag = "scenarios, ngraph",
tag = "scenarios",
params(ProjectIdParam, StudyIdParam, ScenarioIdParam, MacroNodeIdParam),
responses(
(status = 204, description = "The macro node was deleted successfully"),
Expand Down
12 changes: 5 additions & 7 deletions front/src/common/api/generatedEditoastApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ export const addTagTypes = [
'projects',
'studies',
'scenarios',
'nge',
'ngraph',
'rolling_stock_livery',
'search',
'speed_limit_tags',
Expand Down Expand Up @@ -556,7 +554,7 @@ const injectedRtkApi = api
url: `/projects/${queryArg.projectId}/studies/${queryArg.studyId}/scenarios/${queryArg.scenarioId}/macro_nodes`,
params: { page: queryArg.page, page_size: queryArg.pageSize },
}),
providesTags: ['scenarios', 'nge'],
providesTags: ['scenarios'],
}),
postProjectsByProjectIdStudiesAndStudyIdScenariosScenarioIdMacroNodes: build.mutation<
PostProjectsByProjectIdStudiesAndStudyIdScenariosScenarioIdMacroNodesApiResponse,
Expand All @@ -567,7 +565,7 @@ const injectedRtkApi = api
method: 'POST',
body: queryArg.macroNodeForm,
}),
invalidatesTags: ['scenarios', 'nge'],
invalidatesTags: ['scenarios'],
}),
getProjectsByProjectIdStudiesAndStudyIdScenariosScenarioIdMacroNodesNodeId: build.query<
GetProjectsByProjectIdStudiesAndStudyIdScenariosScenarioIdMacroNodesNodeIdApiResponse,
Expand All @@ -576,7 +574,7 @@ const injectedRtkApi = api
query: (queryArg) => ({
url: `/projects/${queryArg.projectId}/studies/${queryArg.studyId}/scenarios/${queryArg.scenarioId}/macro_nodes/${queryArg.nodeId}`,
}),
providesTags: ['scenarios', 'nge'],
providesTags: ['scenarios'],
}),
putProjectsByProjectIdStudiesAndStudyIdScenariosScenarioIdMacroNodesNodeId: build.mutation<
PutProjectsByProjectIdStudiesAndStudyIdScenariosScenarioIdMacroNodesNodeIdApiResponse,
Expand All @@ -587,7 +585,7 @@ const injectedRtkApi = api
method: 'PUT',
body: queryArg.macroNodeForm,
}),
invalidatesTags: ['scenarios', 'nge'],
invalidatesTags: ['scenarios'],
}),
deleteProjectsByProjectIdStudiesAndStudyIdScenariosScenarioIdMacroNodesNodeId: build.mutation<
DeleteProjectsByProjectIdStudiesAndStudyIdScenariosScenarioIdMacroNodesNodeIdApiResponse,
Expand All @@ -597,7 +595,7 @@ const injectedRtkApi = api
url: `/projects/${queryArg.projectId}/studies/${queryArg.studyId}/scenarios/${queryArg.scenarioId}/macro_nodes/${queryArg.nodeId}`,
method: 'DELETE',
}),
invalidatesTags: ['scenarios', 'ngraph'],
invalidatesTags: ['scenarios'],
}),
postRollingStock: build.mutation<PostRollingStockApiResponse, PostRollingStockApiArg>({
query: (queryArg) => ({
Expand Down

0 comments on commit 9709bec

Please sign in to comment.