Modify responseType by Object(json) or Array(json5)

Editor component can't recognize json Array.
(It accepts json Object.)
If json Array, set this.responseBodyType 'json5'.
This commit is contained in:
alyson t
2020-04-26 13:27:51 +09:00
parent 9aec950593
commit 868eab0344

View File

@@ -1474,7 +1474,7 @@ export default {
this.responseType === "application/vnd.api+json"
) {
this.responseBodyText = JSON.stringify(this.response.body, null, 2)
this.responseBodyType = "json"
this.responseBodyType = this.response.body.constructor.name === "Object" ? "json" : "json5"
} else if (this.responseType === "text/html") {
this.responseBodyText = this.response.body
this.responseBodyType = "html"