mirror of
https://github.com/apache/superset.git
synced 2026-04-18 15:44:57 +00:00
fix(explore): redandant force param (#25985)
This commit is contained in:
@@ -169,7 +169,7 @@ class Chart extends React.PureComponent {
|
||||
// Create chart with POST request
|
||||
this.props.actions.postChartFormData(
|
||||
this.props.formData,
|
||||
this.props.force || getUrlParam(URL_PARAMS.force), // allow override via url params force=true
|
||||
Boolean(this.props.force || getUrlParam(URL_PARAMS.force)), // allow override via url params force=true
|
||||
this.props.timeout,
|
||||
this.props.chartId,
|
||||
this.props.dashboardId,
|
||||
|
||||
@@ -183,7 +183,7 @@ const v1ChartDataRequest = async (
|
||||
const qs = {};
|
||||
if (sliceId !== undefined) qs.form_data = `{"slice_id":${sliceId}}`;
|
||||
if (dashboardId !== undefined) qs.dashboard_id = dashboardId;
|
||||
if (force !== false) qs.force = force;
|
||||
if (force) qs.force = force;
|
||||
|
||||
const allowDomainSharding =
|
||||
// eslint-disable-next-line camelcase
|
||||
|
||||
@@ -51,7 +51,7 @@ describe('chart actions', () => {
|
||||
.callsFake(() => MOCK_URL);
|
||||
getChartDataUriStub = sinon
|
||||
.stub(exploreUtils, 'getChartDataUri')
|
||||
.callsFake(() => URI(MOCK_URL));
|
||||
.callsFake(({ qs }) => URI(MOCK_URL).query(qs));
|
||||
fakeMetadata = { useLegacyApi: true };
|
||||
metadataRegistryStub = sinon
|
||||
.stub(chartlib, 'getChartMetadataRegistry')
|
||||
@@ -81,7 +81,7 @@ describe('chart actions', () => {
|
||||
});
|
||||
|
||||
it('should query with the built query', async () => {
|
||||
const actionThunk = actions.postChartFormData({});
|
||||
const actionThunk = actions.postChartFormData({}, null);
|
||||
await actionThunk(dispatch);
|
||||
|
||||
expect(fetchMock.calls(MOCK_URL)).toHaveLength(1);
|
||||
|
||||
Reference in New Issue
Block a user