1
0
Fork 0
mirror of synced 2024-10-03 10:36:59 +13:00

Default rest body type to json when there is an existing body

This commit is contained in:
Rory Powell 2021-12-20 11:46:01 -05:00
parent 5dc6917fb2
commit 4b2ce2a280

View file

@ -36,6 +36,7 @@
import DynamicVariableModal from "../../_components/DynamicVariableModal.svelte"
import Placeholder from "assets/bb-spaceship.svg"
import { cloneDeep } from "lodash/fp"
import { RawRestBodyTypes } from "constants/backend"
let query, datasource
let breakQs = {},
@ -253,7 +254,11 @@
}
}
if (query && !query.fields.bodyType) {
query.fields.bodyType = "none"
if (query.fields.requestBody) {
query.fields.bodyType = RawRestBodyTypes.JSON
} else {
query.fields.bodyType = RawRestBodyTypes.NONE
}
}
dynamicVariables = getDynamicVariables(datasource, query._id)
})