chore: deprecate multiple old APIs (#28492)

This commit is contained in:
Daniel Vaz Gaspar
2024-05-14 22:00:45 +01:00
committed by GitHub
parent 4f693c6db0
commit c12deed12e
11 changed files with 35 additions and 82 deletions

View File

@@ -171,8 +171,8 @@ export function setEditorTabLastUpdate(timestamp) {
export function scheduleQuery(query) {
return dispatch =>
SupersetClient.post({
endpoint: '/savedqueryviewapi/api/create',
postPayload: query,
endpoint: '/api/v1/saved_query/',
jsonPayload: query,
stringify: false,
})
.then(() =>
@@ -1214,7 +1214,7 @@ export function popStoredQuery(urlId) {
export function popSavedQuery(saveQueryId) {
return function (dispatch) {
return SupersetClient.get({
endpoint: `/savedqueryviewapi/api/get/${saveQueryId}`,
endpoint: `/api/v1/saved_query/${saveQueryId}`,
})
.then(({ json }) => {
const queryEditorProps = {
@@ -1222,7 +1222,15 @@ export function popSavedQuery(saveQueryId) {
loaded: true,
autorun: false,
};
return dispatch(addQueryEditor(queryEditorProps));
const tmpAdaptedProps = {
name: queryEditorProps.name,
dbId: queryEditorProps.database.id,
catalog: queryEditorProps.catalog,
schema: queryEditorProps.schema,
sql: queryEditorProps.sql,
templateParams: queryEditorProps.templateParams,
};
return dispatch(addQueryEditor(tmpAdaptedProps));
})
.catch(() => dispatch(addDangerToast(ERR_MSG_CANT_LOAD_QUERY)));
};