geido commented on code in PR #38513:
URL: https://github.com/apache/superset/pull/38513#discussion_r2904620319
##########
superset-frontend/src/explore/exploreUtils/index.ts:
##########
@@ -350,11 +357,16 @@ export const exportChart = async ({
const [useLegacyApi] = getQuerySettings(formData);
if (useLegacyApi) {
const endpointType = getLegacyEndpointType({ resultFormat, resultType });
- url = getExploreUrl({
- formData,
- endpointType,
- allowDomainSharding: false,
- });
+ const directory = getURIDirectory(endpointType);
+ const searchParams = new URLSearchParams();
+ if (endpointType === 'csv') searchParams.set('csv', 'true');
+ if (endpointType === 'xlsx') searchParams.set('xlsx', 'true');
+ if (endpointType === 'results') searchParams.set('results', 'true');
+ if (endpointType === 'query') searchParams.set('query', 'true');
+ if (endpointType === 'samples') searchParams.set('samples', 'true');
+ if (force) searchParams.set('force', 'true');
+ const qs = searchParams.toString();
+ url = qs ? `${directory}?${qs}` : directory;
Review Comment:
Converging into getExploreUrl would mean either refactoring postForm in
@superset-ui/core or adding URL-stripping logic, both have larger blast radius
for the same outcome.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]