mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
[chart] fix, bulk delete endpoint and error message (#9330)
This commit is contained in:
@@ -280,11 +280,9 @@ class ChartList extends React.PureComponent<Props, State> {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
handleBulkDashboardDelete = (charts: Chart[]) => {
|
handleBulkChartDelete = (charts: Chart[]) => {
|
||||||
SupersetClient.delete({
|
SupersetClient.delete({
|
||||||
endpoint: `/api/v1/dashboard/?q=!(${charts
|
endpoint: `/api/v1/chart/?q=!(${charts.map(({ id }) => id).join(',')})`,
|
||||||
.map(({ id }) => id)
|
|
||||||
.join(',')})`,
|
|
||||||
}).then(
|
}).then(
|
||||||
({ json = {} }) => {
|
({ json = {} }) => {
|
||||||
const { lastFetchDataConfig } = this.state;
|
const { lastFetchDataConfig } = this.state;
|
||||||
@@ -296,7 +294,7 @@ class ChartList extends React.PureComponent<Props, State> {
|
|||||||
(err: any) => {
|
(err: any) => {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
this.props.addDangerToast(
|
this.props.addDangerToast(
|
||||||
t('There was an issue deleting the selected dashboards'),
|
t('There was an issue deleting the selected charts'),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -408,7 +406,7 @@ class ChartList extends React.PureComponent<Props, State> {
|
|||||||
description={t(
|
description={t(
|
||||||
'Are you sure you want to delete the selected charts?',
|
'Are you sure you want to delete the selected charts?',
|
||||||
)}
|
)}
|
||||||
onConfirm={this.handleBulkDashboardDelete}
|
onConfirm={this.handleBulkChartDelete}
|
||||||
>
|
>
|
||||||
{confirmDelete => {
|
{confirmDelete => {
|
||||||
const bulkActions = [];
|
const bulkActions = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user