diff --git a/superset-frontend/src/explore/exploreUtils.js b/superset-frontend/src/explore/exploreUtils.js index e13f18ae52..5d7e2065bd 100644 --- a/superset-frontend/src/explore/exploreUtils.js +++ b/superset-frontend/src/explore/exploreUtils.js @@ -198,7 +198,12 @@ export const shouldUseLegacyApi = formData => { return useLegacyApi || false; }; -export const buildV1ChartDataPayload = ({ formData, force }) => { +export const buildV1ChartDataPayload = ({ + formData, + force, + resultFormat, + resultType, +}) => { const buildQuery = getChartBuildQueryRegistry().get(formData.viz_type) ?? (buildQueryformData => @@ -210,6 +215,8 @@ export const buildV1ChartDataPayload = ({ formData, force }) => { return buildQuery({ ...formData, force, + result_format: resultFormat, + result_type: resultType, }); }; @@ -260,13 +267,12 @@ export const exportChart = ({ payload = formData; } else { url = '/api/v1/chart/data'; - const buildQuery = getChartBuildQueryRegistry().get(formData.viz_type); - payload = buildQuery({ - ...formData, + payload = buildV1ChartDataPayload({ + formData, force, + resultFormat, + resultType, }); - payload.result_type = resultType; - payload.result_format = resultFormat; } postForm(url, payload); };