Sync bodyParams and rawBodyParams (#1562)

Co-authored-by: Liyas Thomas <liyascthomas@gmail.com>
Co-authored-by: Joel DSouza <joel.dsouza@kapturecrm.com>
This commit is contained in:
Joel D Souza
2021-04-10 13:33:37 +05:30
committed by GitHub
parent db45f08905
commit f6db530de2
3 changed files with 64 additions and 16 deletions

View File

@@ -1037,6 +1037,22 @@ export default {
},
set(value) {
this.$store.commit("setState", { value, attribute: "rawParams" })
// Convert the rawParams to bodyParams format
try{
const valueObj = JSON.parse(value)
const params = Object.keys(valueObj).map(key=>{
if(typeof valueObj[key] !== "function"){
return {
active: true,
key,
value: valueObj[key]
}
}
})
this.$store.commit("setBodyParams", { params })
} catch {
}
},
},
rawInput: {