This commit is contained in:
Anna Bodnia
2017-04-19 11:28:35 +03:00
13 changed files with 137 additions and 62 deletions

View File

@@ -97,7 +97,11 @@ export default {
},
[UPDATE_OPERATION_VALUE]: (state, { payload: { path, value, key } }) => {
return state.setIn(["resolved", "paths", ...path, key], fromJS(value))
let operationPath = ["resolved", "paths", ...path]
if(!state.getIn(operationPath)) {
return state
}
return state.setIn([...operationPath, key], fromJS(value))
},
[CLEAR_RESPONSE]: (state, { payload: { path, method } } ) =>{

View File

@@ -299,7 +299,7 @@ export const operationScheme = ( state, path, method ) => {
let matchResult = url.match(/^([a-z][a-z0-9+\-.]*):/)
let urlScheme = Array.isArray(matchResult) ? matchResult[1] : null
return state.getIn(["scheme", path, method]) || state.getIn(["scheme", "_defaultScheme"]) || urlScheme || "http"
return state.getIn(["scheme", path, method]) || state.getIn(["scheme", "_defaultScheme"]) || urlScheme || ""
}
export const canExecuteScheme = ( state, path, method ) => {