Skip to content

Commit e7a1876

Browse files
authored
fix(explore): redandant force param (#25985)
1 parent 5fccf67 commit e7a1876

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

superset-frontend/src/components/Chart/Chart.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ class Chart extends React.PureComponent {
169169
// Create chart with POST request
170170
this.props.actions.postChartFormData(
171171
this.props.formData,
172-
this.props.force || getUrlParam(URL_PARAMS.force), // allow override via url params force=true
172+
Boolean(this.props.force || getUrlParam(URL_PARAMS.force)), // allow override via url params force=true
173173
this.props.timeout,
174174
this.props.chartId,
175175
this.props.dashboardId,

superset-frontend/src/components/Chart/chartAction.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ const v1ChartDataRequest = async (
183183
const qs = {};
184184
if (sliceId !== undefined) qs.form_data = `{"slice_id":${sliceId}}`;
185185
if (dashboardId !== undefined) qs.dashboard_id = dashboardId;
186-
if (force !== false) qs.force = force;
186+
if (force) qs.force = force;
187187

188188
const allowDomainSharding =
189189
// eslint-disable-next-line camelcase

superset-frontend/src/components/Chart/chartActions.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ describe('chart actions', () => {
5151
.callsFake(() => MOCK_URL);
5252
getChartDataUriStub = sinon
5353
.stub(exploreUtils, 'getChartDataUri')
54-
.callsFake(() => URI(MOCK_URL));
54+
.callsFake(({ qs }) => URI(MOCK_URL).query(qs));
5555
fakeMetadata = { useLegacyApi: true };
5656
metadataRegistryStub = sinon
5757
.stub(chartlib, 'getChartMetadataRegistry')
@@ -81,7 +81,7 @@ describe('chart actions', () => {
8181
});
8282

8383
it('should query with the built query', async () => {
84-
const actionThunk = actions.postChartFormData({});
84+
const actionThunk = actions.postChartFormData({}, null);
8585
await actionThunk(dispatch);
8686

8787
expect(fetchMock.calls(MOCK_URL)).toHaveLength(1);

0 commit comments

Comments
 (0)