Skip to content

Commit f81ada6

Browse files
authored
fix: send lineage request with dialect from localStorage (#388)
1 parent de10fc5 commit f81ada6

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

sqllineagejs/src/features/editor/Editor.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ export function Editor(props) {
3939
dispatch(setDagLevel("table"));
4040
if (file === null) {
4141
dispatch(setEditable(true));
42-
dispatch(fetchDAG({"e": editorState.contentComposed, "dialect": dialect}))
42+
dispatch(fetchDAG({"e": editorState.contentComposed}))
4343
} else {
4444
dispatch(setEditable(false));
4545
dispatch(fetchContent({"f": file}));
46-
dispatch(fetchDAG({"f": file, "dialect": dialect}));
46+
dispatch(fetchDAG({"f": file}));
4747
}
4848
}
4949
}
@@ -54,7 +54,7 @@ export function Editor(props) {
5454
editor.onDidBlurEditorText(() => {
5555
if (!editor.getOption(readOnly)) {
5656
dispatch(setContentComposed(editor.getValue()));
57-
dispatch(fetchDAG({"e": editor.getValue(), "dialect": dialect}));
57+
dispatch(fetchDAG({"e": editor.getValue()}));
5858
}
5959
})
6060
editor.onKeyDown(() => {

sqllineagejs/src/features/editor/editorSlice.js

+4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ export const fetchContent = createAsyncThunk('editor/fetchContent', async (paylo
2222
})
2323

2424
export const fetchDAG = createAsyncThunk('dag/fetchDAG', async (payload) => {
25+
let dialect = localStorage.getItem("dialect");
26+
if (dialect !== null) {
27+
payload["dialect"] = dialect
28+
}
2529
return await client.post(assemble_absolute_endpoint("/lineage"), payload);
2630
})
2731

0 commit comments

Comments
 (0)