mirror of https://github.com/apache/superset.git
fix: chart export fails when buildQuery not present (#10062)
This commit is contained in:
parent
7504b1cf20
commit
d3a9ce5afc
|
@ -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);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue