Skip to content

Commit

Permalink
fix(explore): redandant force param (apache#25985)
Browse files Browse the repository at this point in the history
  • Loading branch information
justinpark authored and sfirke committed Mar 22, 2024
1 parent c47f316 commit 858fe44
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion superset-frontend/src/components/Chart/Chart.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion superset-frontend/src/components/Chart/chartAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions superset-frontend/src/components/Chart/chartActions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 858fe44

Please sign in to comment.