From 6f98fa9f3b03ea05a834cf9a71d615c9adcf5d1e Mon Sep 17 00:00:00 2001 From: Owen Conti Date: Fri, 15 Sep 2017 22:31:02 -0600 Subject: [PATCH] Fixes after merge with ft/3584 branch --- src/core/components/responses.jsx | 10 +++++----- src/core/plugins/oas3/actions.js | 4 ++-- src/core/plugins/oas3/reducers.js | 3 +-- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/core/components/responses.jsx b/src/core/components/responses.jsx index 63708b2d..832201b4 100644 --- a/src/core/components/responses.jsx +++ b/src/core/components/responses.jsx @@ -15,7 +15,7 @@ export default class Responses extends React.Component { getComponent: PropTypes.func.isRequired, specSelectors: PropTypes.object.isRequired, specActions: PropTypes.object.isRequired, - oas3Actions: PropTypes.object.isRequired, + oas3Actions: PropTypes.object.isRequired, fn: PropTypes.object.isRequired, getConfigs: PropTypes.func.isRequired } @@ -38,14 +38,15 @@ export default class Responses extends React.Component { return render } - onChangeProducesWrapper = ( val ) => this.props.specActions.changeProducesValue(this.props.pathMethod, val) + onChangeProducesWrapper = ( val ) => this.props.specActions.changeProducesValue(this.props.path, this.props.method, val) onResponseContentTypeChange = ({ controlsAcceptHeader, value }) => { - const { oas3Actions, pathMethod } = this.props + const { oas3Actions, path, method } = this.props if(controlsAcceptHeader) { oas3Actions.setResponseContentType({ value, - pathMethod + path, + method }) } } @@ -53,7 +54,6 @@ export default class Responses extends React.Component { render() { let { responses, - request, tryItOutResponse, getComponent, getConfigs, diff --git a/src/core/plugins/oas3/actions.js b/src/core/plugins/oas3/actions.js index ad81f3e7..c9abc855 100644 --- a/src/core/plugins/oas3/actions.js +++ b/src/core/plugins/oas3/actions.js @@ -28,10 +28,10 @@ export function setRequestContentType ({ value, pathMethod }) { } } -export function setResponseContentType ({ value, pathMethod }) { +export function setResponseContentType ({ value, path, method }) { return { type: UPDATE_RESPONSE_CONTENT_TYPE, - payload: { value, pathMethod } + payload: { value, path, method } } } diff --git a/src/core/plugins/oas3/reducers.js b/src/core/plugins/oas3/reducers.js index 149f55e3..8590284d 100644 --- a/src/core/plugins/oas3/reducers.js +++ b/src/core/plugins/oas3/reducers.js @@ -18,8 +18,7 @@ export default { let [path, method] = pathMethod return state.setIn( [ "requestData", path, method, "requestContentType" ], value) }, - [UPDATE_RESPONSE_CONTENT_TYPE]: (state, { payload: { value, pathMethod } } ) =>{ - let [path, method] = pathMethod + [UPDATE_RESPONSE_CONTENT_TYPE]: (state, { payload: { value, path, method } } ) =>{ return state.setIn( [ "requestData", path, method, "responseContentType" ], value) }, [UPDATE_SERVER_VARIABLE_VALUE]: (state, { payload: { server, key, val } } ) =>{