fix(req-body): ensure raw input if !canListParameters

This commit is contained in:
Leonardo Matos
2020-03-20 15:40:04 -03:00
committed by GitHub
parent 86ee80f607
commit dc771f51e8

View File

@@ -1432,8 +1432,11 @@ export default {
]) ])
}, },
}, },
canListParameters(canToggleRaw) { canListParameters: {
this.rawInput = !canToggleRaw immediate: true,
handler (canToggleRaw) {
this.rawInput = !canToggleRaw
}
}, },
contentType(contentType, oldContentType) { contentType(contentType, oldContentType) {
const getDefaultParams = contentType => { const getDefaultParams = contentType => {
@@ -1544,11 +1547,7 @@ export default {
"text/plain", "text/plain",
], ],
canListParameters() { canListParameters() {
return [ this.contentType === "application/x-www-form-urlencoded"
"application/json",
"application/hal+json",
"application/x-www-form-urlencoded",
].includes(this.contentType)
}, },
uri: { uri: {
get() { get() {
@@ -1765,7 +1764,7 @@ export default {
}, },
rawInput: { rawInput: {
get() { get() {
return this.$store.state.request.rawInput return this.canListParameter ? this.$store.state.request.rawInput : true
}, },
set(value) { set(value) {
this.$store.commit("setState", { value, attribute: "rawInput" }) this.$store.commit("setState", { value, attribute: "rawInput" })