Skip to content

Commit

Permalink
fix(ui): Request Panel > Body dropdown > graphql content type is inco…
Browse files Browse the repository at this point in the history
…rrect & no body getting set as content type (fixes #185)
  • Loading branch information
flawiddsouza committed Jul 18, 2024
1 parent 97029b5 commit 33deb5d
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions packages/ui/src/components/RequestPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,8 @@ export default {
this.showRequestBodyMenu = true
},
handleRequestBodyMenuClick(newMimeType) {
this.activeTab.body.mimeType = newMimeType

let mimeType = null

if(newMimeType === constants.MIME_TYPE.FORM_URL_ENCODED) {
Expand All @@ -804,18 +806,10 @@ export default {
mimeType = constants.MIME_TYPE.TEXT_PLAIN
}

if(newMimeType === constants.MIME_TYPE.JSON) {
if(newMimeType === constants.MIME_TYPE.JSON || newMimeType === constants.MIME_TYPE.GRAPHQL) {
mimeType = constants.MIME_TYPE.JSON
}

if(newMimeType === constants.MIME_TYPE.GRAPHQL) {
mimeType = constants.MIME_TYPE.GRAPHQL
}

if(newMimeType === 'No Body') {
mimeType = newMimeType
}

if(newMimeType === constants.MIME_TYPE.OCTET_STREAM) {
mimeType = constants.MIME_TYPE.OCTET_STREAM
}
Expand Down Expand Up @@ -843,7 +837,6 @@ export default {
value: mimeType
})
}
this.activeTab.body.mimeType = mimeType
},
handleCustomHttpMethod(method) {
this.activeTab.method = method
Expand Down

0 comments on commit 33deb5d

Please sign in to comment.