Skip to content

Commit 86b96e6

Browse files
emersionwoshilapin
authored andcommitted
front: avoid sending empty nodes in storeTrainPathNodes()
MacroEditorState.nodes includes null entries in case some nodes got dedup'ed. The filter() condition retains these null nodes, resulting in empty objects sent to editoast and a 400 HTTP error when opening the macro editor. Ignore null nodes in the filter() condition to fix this. Signed-off-by: Simon Ser <[email protected]> Fixes: fb24ab4 ("front: persist nodes from file import in nge") Closes: #14425
1 parent 2a4cb8e commit 86b96e6

File tree

1 file changed

+1
-1
lines changed
  • front/src/applications/operationalStudies/views/Scenario/components/MacroEditor

1 file changed

+1
-1
lines changed

front/src/applications/operationalStudies/views/Scenario/components/MacroEditor/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export const storeRoundTrip = async (
153153
* If not we persist them.
154154
*/
155155
export const storeTrainPathNodes = async (state: MacroEditorState, dispatch: AppDispatch) => {
156-
const allNodes = state.nodes.filter((n) => !n?.dbId);
156+
const allNodes = state.nodes.filter((n) => n && !n.dbId);
157157

158158
if (!allNodes.length) return;
159159

0 commit comments

Comments
 (0)