chore(sqllab): Remove functionNames from sqlLab state (#24026)

This commit is contained in:
JUST.in DO IT
2023-05-23 10:42:00 -07:00
committed by GitHub
parent 8e45af43e1
commit 779b372d89
12 changed files with 161 additions and 63 deletions

View File

@@ -1555,34 +1555,3 @@ export function createCtasDatasource(vizOptions) {
});
};
}
export function queryEditorSetFunctionNames(queryEditor, dbId) {
return function (dispatch) {
return SupersetClient.get({
endpoint: encodeURI(`/api/v1/database/${dbId}/function_names/`),
})
.then(({ json }) =>
dispatch({
type: QUERY_EDITOR_SET_FUNCTION_NAMES,
queryEditor,
functionNames: json.function_names,
}),
)
.catch(err => {
if (err.status === 404) {
// for databases that have been deleted, just reset the function names
dispatch({
type: QUERY_EDITOR_SET_FUNCTION_NAMES,
queryEditor,
functionNames: [],
});
} else {
dispatch(
addDangerToast(
t('An error occurred while fetching function names.'),
),
);
}
});
};
}