chore: Migrate /superset/csv/<client_id> to API v1 (#22913)

This commit is contained in:
Diego Medina
2023-02-15 07:48:24 -03:00
committed by GitHub
parent 3fae7dbc34
commit e5a4c78dc7
7 changed files with 526 additions and 79 deletions

View File

@@ -219,6 +219,9 @@ const ResultSet = ({
}
};
const getExportCsvUrl = (clientId: string) =>
`/api/v1/sqllab/export/${clientId}/`;
const renderControls = () => {
if (search || visualize || csv) {
let { data } = query.results;
@@ -257,7 +260,7 @@ const ResultSet = ({
/>
)}
{csv && (
<Button buttonSize="small" href={`/superset/csv/${query.id}`}>
<Button buttonSize="small" href={getExportCsvUrl(query.id)}>
<i className="fa fa-file-text-o" /> {t('Download to CSV')}
</Button>
)}