chore: Migrate get_or_create_table endpoint to api v1 (#22931)

This commit is contained in:
Jack Fragassi
2023-02-15 02:38:51 -08:00
committed by GitHub
parent 7d7e3e4ade
commit 3fae7dbc34
10 changed files with 237 additions and 18 deletions

View File

@@ -1513,13 +1513,13 @@ export function createCtasDatasource(vizOptions) {
return dispatch => {
dispatch(createDatasourceStarted());
return SupersetClient.post({
endpoint: '/superset/get_or_create_table/',
postPayload: { data: vizOptions },
endpoint: '/api/v1/dataset/get_or_create/',
jsonPayload: vizOptions,
})
.then(({ json }) => {
dispatch(createDatasourceSuccess(json));
dispatch(createDatasourceSuccess(json.result));
return json;
return json.result;
})
.catch(() => {
const errorMsg = t('An error occurred while creating the data source');