Merge branch 'main' of https://github.com/hoppscotch/hoppscotch
This commit is contained in:
126
components/http/http-body-parameters.vue
Normal file
126
components/http/http-body-parameters.vue
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<div class="row-wrapper">
|
||||||
|
<label for="reqParamList">{{ $t("parameter_list") }}</label>
|
||||||
|
<div>
|
||||||
|
<button
|
||||||
|
class="icon"
|
||||||
|
@click="clearContent('bodyParams', $event)"
|
||||||
|
v-tooltip.bottom="$t('clear')"
|
||||||
|
>
|
||||||
|
<i class="material-icons">clear_all</i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<ul
|
||||||
|
v-for="(param, index) in bodyParams"
|
||||||
|
:key="index"
|
||||||
|
class="border-b border-dashed divide-y md:divide-x border-brdColor divide-dashed divide-brdColor md:divide-y-0"
|
||||||
|
:class="{ 'border-t': index == 0 }"
|
||||||
|
>
|
||||||
|
<li>
|
||||||
|
<input
|
||||||
|
:placeholder="`key ${index + 1}`"
|
||||||
|
:name="`bparam ${index}`"
|
||||||
|
:value="param.key"
|
||||||
|
@change="
|
||||||
|
$store.commit('setKeyBodyParams', {
|
||||||
|
index,
|
||||||
|
value: $event.target.value,
|
||||||
|
})
|
||||||
|
"
|
||||||
|
@keyup.prevent="setRouteQueryState"
|
||||||
|
autofocus
|
||||||
|
/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<input
|
||||||
|
:placeholder="`value ${index + 1}`"
|
||||||
|
:value="param.value"
|
||||||
|
@change="
|
||||||
|
$store.commit('setValueBodyParams', {
|
||||||
|
index,
|
||||||
|
value: $event.target.value,
|
||||||
|
})
|
||||||
|
"
|
||||||
|
@keyup.prevent="setRouteQueryState"
|
||||||
|
/>
|
||||||
|
</li>
|
||||||
|
<div>
|
||||||
|
<li>
|
||||||
|
<button
|
||||||
|
class="icon"
|
||||||
|
@click="
|
||||||
|
$store.commit('setActiveBodyParams', {
|
||||||
|
index,
|
||||||
|
value: param.hasOwnProperty('active') ? !param.active : false,
|
||||||
|
})
|
||||||
|
"
|
||||||
|
v-tooltip.bottom="{
|
||||||
|
content: param.hasOwnProperty('active')
|
||||||
|
? param.active
|
||||||
|
? $t('turn_off')
|
||||||
|
: $t('turn_on')
|
||||||
|
: $t('turn_off'),
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<i class="material-icons">
|
||||||
|
{{
|
||||||
|
param.hasOwnProperty("active")
|
||||||
|
? param.active
|
||||||
|
? "check_box"
|
||||||
|
: "check_box_outline_blank"
|
||||||
|
: "check_box"
|
||||||
|
}}
|
||||||
|
</i>
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<li>
|
||||||
|
<button
|
||||||
|
class="icon"
|
||||||
|
@click="removeRequestBodyParam(index)"
|
||||||
|
v-tooltip.bottom="$t('delete')"
|
||||||
|
>
|
||||||
|
<i class="material-icons">delete</i>
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
</div>
|
||||||
|
</ul>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<button class="icon" @click="addRequestBodyParam" name="addrequest">
|
||||||
|
<i class="material-icons">add</i>
|
||||||
|
<span>{{ $t("add_new") }}</span>
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
bodyParams: { type: Array, default: () => [] },
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
clearContent(bodyParams, $event) {
|
||||||
|
this.$emit("clear-content", bodyParams, $event)
|
||||||
|
},
|
||||||
|
setRouteQueryState() {
|
||||||
|
this.$emit("set-route-query-state")
|
||||||
|
},
|
||||||
|
removeRequestBodyParam(index) {
|
||||||
|
this.$emit("remove-request-body-param", index)
|
||||||
|
},
|
||||||
|
addRequestBodyParam() {
|
||||||
|
this.$emit("add-request-body-param")
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -56,10 +56,35 @@
|
|||||||
<li>
|
<li>
|
||||||
<button
|
<button
|
||||||
class="icon"
|
class="icon"
|
||||||
@click="removeRequestHeader(index)"
|
@click="
|
||||||
v-tooltip.bottom="$t('delete')"
|
$store.commit('setActiveHeader', {
|
||||||
id="header"
|
index,
|
||||||
|
value: header.hasOwnProperty('active') ? !header.active : false,
|
||||||
|
})
|
||||||
|
"
|
||||||
|
v-tooltip.bottom="{
|
||||||
|
content: header.hasOwnProperty('active')
|
||||||
|
? header.active
|
||||||
|
? $t('turn_off')
|
||||||
|
: $t('turn_on')
|
||||||
|
: $t('turn_off'),
|
||||||
|
}"
|
||||||
>
|
>
|
||||||
|
<i class="material-icons">
|
||||||
|
{{
|
||||||
|
header.hasOwnProperty("active")
|
||||||
|
? header.active
|
||||||
|
? "check_box"
|
||||||
|
: "check_box_outline_blank"
|
||||||
|
: "check_box"
|
||||||
|
}}
|
||||||
|
</i>
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<li>
|
||||||
|
<button class="icon" @click="removeRequestHeader(index)" v-tooltip.bottom="$t('delete')">
|
||||||
<i class="material-icons">delete</i>
|
<i class="material-icons">delete</i>
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -73,10 +73,35 @@
|
|||||||
<li>
|
<li>
|
||||||
<button
|
<button
|
||||||
class="icon"
|
class="icon"
|
||||||
@click="removeRequestParam(index)"
|
@click="
|
||||||
v-tooltip.bottom="$t('delete')"
|
$store.commit('setActiveParams', {
|
||||||
id="param"
|
index,
|
||||||
|
value: param.hasOwnProperty('active') ? !param.active : false,
|
||||||
|
})
|
||||||
|
"
|
||||||
|
v-tooltip.bottom="{
|
||||||
|
content: param.hasOwnProperty('active')
|
||||||
|
? param.active
|
||||||
|
? $t('turn_off')
|
||||||
|
: $t('turn_on')
|
||||||
|
: $t('turn_off'),
|
||||||
|
}"
|
||||||
>
|
>
|
||||||
|
<i class="material-icons">
|
||||||
|
{{
|
||||||
|
param.hasOwnProperty("active")
|
||||||
|
? param.active
|
||||||
|
? "check_box"
|
||||||
|
: "check_box_outline_blank"
|
||||||
|
: "check_box"
|
||||||
|
}}
|
||||||
|
</i>
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<li>
|
||||||
|
<button class="icon" @click="removeRequestParam(index)" v-tooltip.bottom="$t('delete')">
|
||||||
<i class="material-icons">delete</i>
|
<i class="material-icons">delete</i>
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
export function hasPathParams(params) {
|
export function hasPathParams(params) {
|
||||||
return params.some(({ type }) => type === "path")
|
return params
|
||||||
|
.filter((item) => (item.hasOwnProperty("active") ? item.active == true : true))
|
||||||
|
.some(({ type }) => type === "path")
|
||||||
}
|
}
|
||||||
|
|
||||||
export function addPathParamsToVariables(params, variables) {
|
export function addPathParamsToVariables(params, variables) {
|
||||||
params
|
params
|
||||||
|
.filter((item) => (item.hasOwnProperty("active") ? item.active == true : true))
|
||||||
.filter(({ key }) => !!key)
|
.filter(({ key }) => !!key)
|
||||||
.filter(({ type }) => type === "path")
|
.filter(({ type }) => type === "path")
|
||||||
.forEach(({ key, value }) => (variables[key] = value))
|
.forEach(({ key, value }) => (variables[key] = value))
|
||||||
@@ -11,5 +14,8 @@ export function addPathParamsToVariables(params, variables) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getQueryParams(params) {
|
export function getQueryParams(params) {
|
||||||
return params.filter(({ key }) => !!key).filter(({ type }) => type != "path")
|
return params
|
||||||
|
.filter((item) => (item.hasOwnProperty("active") ? item.active == true : true))
|
||||||
|
.filter(({ key }) => !!key)
|
||||||
|
.filter(({ type }) => type != "path")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -264,6 +264,7 @@
|
|||||||
"syncCollections": "Collections",
|
"syncCollections": "Collections",
|
||||||
"syncEnvironments": "Environments",
|
"syncEnvironments": "Environments",
|
||||||
"turn_on": "Turn on",
|
"turn_on": "Turn on",
|
||||||
|
"turn_off": "Turn off",
|
||||||
"login_first": "Login first",
|
"login_first": "Login first",
|
||||||
"paste_a_note": "Paste a note",
|
"paste_a_note": "Paste a note",
|
||||||
"import_from_sync": "Import from Sync",
|
"import_from_sync": "Import from Sync",
|
||||||
|
|||||||
129
pages/index.vue
129
pages/index.vue
@@ -151,81 +151,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div v-if="!rawInput">
|
<http-body-parameters
|
||||||
<ul>
|
v-if="!rawInput"
|
||||||
<li>
|
:bodyParams="bodyParams"
|
||||||
<div class="row-wrapper">
|
@clear-content="clearContent"
|
||||||
<label for="reqParamList">{{ $t("parameter_list") }}</label>
|
@set-route-query-state="setRouteQueryState"
|
||||||
<div>
|
@remove-request-body-param="removeRequestBodyParam"
|
||||||
<button
|
@add-request-body-param="addRequestBodyParam"
|
||||||
class="icon"
|
/>
|
||||||
@click="clearContent('bodyParams', $event)"
|
|
||||||
v-tooltip.bottom="$t('clear')"
|
|
||||||
>
|
|
||||||
<i class="material-icons">clear_all</i>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<ul
|
|
||||||
v-for="(param, index) in bodyParams"
|
|
||||||
:key="index"
|
|
||||||
class="border-b border-dashed divide-y md:divide-x border-brdColor divide-dashed divide-brdColor md:divide-y-0"
|
|
||||||
:class="{ 'border-t': index == 0 }"
|
|
||||||
>
|
|
||||||
<li>
|
|
||||||
<input
|
|
||||||
:placeholder="`key ${index + 1}`"
|
|
||||||
:name="`bparam ${index}`"
|
|
||||||
:value="param.key"
|
|
||||||
@change="
|
|
||||||
$store.commit('setKeyBodyParams', {
|
|
||||||
index,
|
|
||||||
value: $event.target.value,
|
|
||||||
})
|
|
||||||
"
|
|
||||||
@keyup.prevent="setRouteQueryState"
|
|
||||||
autofocus
|
|
||||||
/>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<input
|
|
||||||
:placeholder="`value ${index + 1}`"
|
|
||||||
:id="`bvalue ${index}`"
|
|
||||||
:name="'bvalue' + index"
|
|
||||||
:value="param.value"
|
|
||||||
@change="
|
|
||||||
$store.commit('setValueBodyParams', {
|
|
||||||
index,
|
|
||||||
value: $event.target.value,
|
|
||||||
})
|
|
||||||
"
|
|
||||||
@keyup.prevent="setRouteQueryState"
|
|
||||||
/>
|
|
||||||
</li>
|
|
||||||
<div>
|
|
||||||
<li>
|
|
||||||
<button
|
|
||||||
class="icon"
|
|
||||||
@click="removeRequestBodyParam(index)"
|
|
||||||
v-tooltip.bottom="$t('delete')"
|
|
||||||
id="delParam"
|
|
||||||
>
|
|
||||||
<i class="material-icons">delete</i>
|
|
||||||
</button>
|
|
||||||
</li>
|
|
||||||
</div>
|
|
||||||
</ul>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
<button class="icon" @click="addRequestBodyParam" name="addrequest">
|
|
||||||
<i class="material-icons">add</i>
|
|
||||||
<span>{{ $t("add_new") }}</span>
|
|
||||||
</button>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
@@ -261,7 +194,6 @@
|
|||||||
<span>
|
<span>
|
||||||
<button
|
<button
|
||||||
class="icon"
|
class="icon"
|
||||||
id="show-modal"
|
|
||||||
@click="showCurlImportModal = !showCurlImportModal"
|
@click="showCurlImportModal = !showCurlImportModal"
|
||||||
v-tooltip.bottom="$t('import_curl')"
|
v-tooltip.bottom="$t('import_curl')"
|
||||||
>
|
>
|
||||||
@@ -269,7 +201,6 @@
|
|||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="icon"
|
class="icon"
|
||||||
id="code"
|
|
||||||
@click="showCodegenModal = !showCodegenModal"
|
@click="showCodegenModal = !showCodegenModal"
|
||||||
:disabled="!isValidURL"
|
:disabled="!isValidURL"
|
||||||
v-tooltip.bottom="$t('show_code')"
|
v-tooltip.bottom="$t('show_code')"
|
||||||
@@ -281,7 +212,6 @@
|
|||||||
<button
|
<button
|
||||||
class="icon"
|
class="icon"
|
||||||
@click="copyRequest"
|
@click="copyRequest"
|
||||||
id="copyRequest"
|
|
||||||
ref="copyRequest"
|
ref="copyRequest"
|
||||||
:disabled="!isValidURL"
|
:disabled="!isValidURL"
|
||||||
v-tooltip.bottom="$t('copy_request_link')"
|
v-tooltip.bottom="$t('copy_request_link')"
|
||||||
@@ -292,7 +222,6 @@
|
|||||||
<button
|
<button
|
||||||
class="icon"
|
class="icon"
|
||||||
@click="saveRequest"
|
@click="saveRequest"
|
||||||
id="saveRequest"
|
|
||||||
ref="saveRequest"
|
ref="saveRequest"
|
||||||
:disabled="!isValidURL"
|
:disabled="!isValidURL"
|
||||||
v-tooltip.bottom="$t('save_to_collections')"
|
v-tooltip.bottom="$t('save_to_collections')"
|
||||||
@@ -383,12 +312,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<div>
|
<div>
|
||||||
<li>
|
<li>
|
||||||
<button
|
<button class="icon" ref="switchVisibility" @click="switchVisibility">
|
||||||
class="icon"
|
|
||||||
id="switchVisibility"
|
|
||||||
ref="switchVisibility"
|
|
||||||
@click="switchVisibility"
|
|
||||||
>
|
|
||||||
<i class="material-icons" v-if="passwordFieldType === 'text'">visibility</i>
|
<i class="material-icons" v-if="passwordFieldType === 'text'">visibility</i>
|
||||||
<i class="material-icons" v-if="passwordFieldType !== 'text'"
|
<i class="material-icons" v-if="passwordFieldType !== 'text'"
|
||||||
>visibility_off</i
|
>visibility_off</i
|
||||||
@@ -1267,12 +1191,9 @@ export default {
|
|||||||
try {
|
try {
|
||||||
const obj = JSON.parse(
|
const obj = JSON.parse(
|
||||||
`{${bodyParams
|
`{${bodyParams
|
||||||
|
.filter((item) => (item.hasOwnProperty("active") ? item.active == true : true))
|
||||||
.filter(({ key }) => !!key)
|
.filter(({ key }) => !!key)
|
||||||
.map(
|
.map(({ key, value }) => `"${key}": "${value}"`)
|
||||||
({ key, value }) => `
|
|
||||||
"${key}": "${value}"
|
|
||||||
`
|
|
||||||
)
|
|
||||||
.join()}}`
|
.join()}}`
|
||||||
)
|
)
|
||||||
return JSON.stringify(obj, null, 2)
|
return JSON.stringify(obj, null, 2)
|
||||||
@@ -1289,33 +1210,26 @@ export default {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return bodyParams
|
return bodyParams
|
||||||
|
.filter((item) => (item.hasOwnProperty("active") ? item.active == true : true))
|
||||||
.filter(({ key }) => !!key)
|
.filter(({ key }) => !!key)
|
||||||
.map(({ key, value }) => `${key}=${encodeURIComponent(value)}`)
|
.map(({ key, value }) => `${key}=${encodeURIComponent(value)}`)
|
||||||
.join("&")
|
.join("&")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
headerString() {
|
|
||||||
const result = this.headers
|
|
||||||
.filter(({ key }) => !!key)
|
|
||||||
.map(({ key, value }) => `${key}: ${value}`)
|
|
||||||
.join(",\n")
|
|
||||||
return result === "" ? "" : `${result}`
|
|
||||||
},
|
|
||||||
queryString() {
|
queryString() {
|
||||||
const result = getQueryParams(this.params)
|
const result = getQueryParams(this.params)
|
||||||
.map(({ key, value }) => `${key}=${encodeURIComponent(value)}`)
|
.map(({ key, value }) => `${key}=${encodeURIComponent(value)}`)
|
||||||
.join("&")
|
.join("&")
|
||||||
return result === "" ? "" : `?${result}`
|
return result === "" ? "" : `?${result}`
|
||||||
},
|
},
|
||||||
responseType() {
|
|
||||||
return (this.response.headers["content-type"] || "").split(";")[0].toLowerCase()
|
|
||||||
},
|
|
||||||
requestCode() {
|
requestCode() {
|
||||||
let headers = []
|
let headers = []
|
||||||
if (this.preRequestScript || hasPathParams(this.params)) {
|
if (this.preRequestScript || hasPathParams(this.params)) {
|
||||||
let environmentVariables = getEnvironmentVariablesFromScript(this.preRequestScript)
|
let environmentVariables = getEnvironmentVariablesFromScript(this.preRequestScript)
|
||||||
environmentVariables = addPathParamsToVariables(this.params, environmentVariables)
|
environmentVariables = addPathParamsToVariables(this.params, environmentVariables)
|
||||||
for (let k of this.headers) {
|
for (let k of this.headers.filter((item) =>
|
||||||
|
item.hasOwnProperty("active") ? item.active == true : true
|
||||||
|
)) {
|
||||||
const kParsed = parseTemplateString(k.key, environmentVariables)
|
const kParsed = parseTemplateString(k.key, environmentVariables)
|
||||||
const valParsed = parseTemplateString(k.value, environmentVariables)
|
const valParsed = parseTemplateString(k.value, environmentVariables)
|
||||||
headers.push({ key: kParsed, value: valParsed })
|
headers.push({ key: kParsed, value: valParsed })
|
||||||
@@ -1489,7 +1403,12 @@ export default {
|
|||||||
headers = Object.assign(
|
headers = Object.assign(
|
||||||
// Clone the app headers object first, we don't want to
|
// Clone the app headers object first, we don't want to
|
||||||
// mutate it with the request headers added by default.
|
// mutate it with the request headers added by default.
|
||||||
Object.assign({}, this.headers)
|
Object.assign(
|
||||||
|
{},
|
||||||
|
this.headers.filter((item) =>
|
||||||
|
item.hasOwnProperty("active") ? item.active == true : true
|
||||||
|
)
|
||||||
|
)
|
||||||
// We make our temporary headers object the source so
|
// We make our temporary headers object the source so
|
||||||
// that you can override the added headers if you
|
// that you can override the added headers if you
|
||||||
// specify them.
|
// specify them.
|
||||||
@@ -1673,6 +1592,7 @@ export default {
|
|||||||
return Object.keys(queryParsed).map((key) => ({
|
return Object.keys(queryParsed).map((key) => ({
|
||||||
key,
|
key,
|
||||||
value: queryParsed[key],
|
value: queryParsed[key],
|
||||||
|
active: true,
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
pathInputHandler() {
|
pathInputHandler() {
|
||||||
@@ -1687,6 +1607,7 @@ export default {
|
|||||||
this.$store.commit("addHeaders", {
|
this.$store.commit("addHeaders", {
|
||||||
key: "",
|
key: "",
|
||||||
value: "",
|
value: "",
|
||||||
|
active: true,
|
||||||
})
|
})
|
||||||
return false
|
return false
|
||||||
},
|
},
|
||||||
@@ -1706,7 +1627,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
addRequestParam() {
|
addRequestParam() {
|
||||||
this.$store.commit("addParams", { key: "", value: "", type: "query" })
|
this.$store.commit("addParams", { key: "", value: "", type: "query", active: true })
|
||||||
return false
|
return false
|
||||||
},
|
},
|
||||||
removeRequestParam(index) {
|
removeRequestParam(index) {
|
||||||
@@ -1725,7 +1646,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
addRequestBodyParam() {
|
addRequestBodyParam() {
|
||||||
this.$store.commit("addBodyParams", { key: "", value: "" })
|
this.$store.commit("addBodyParams", { key: "", value: "", active: true })
|
||||||
return false
|
return false
|
||||||
},
|
},
|
||||||
removeRequestBodyParam(index) {
|
removeRequestBodyParam(index) {
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import Vue from "vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
setState({ request }, { attribute, value }) {
|
setState({ request }, { attribute, value }) {
|
||||||
request[attribute] = value
|
request[attribute] = value
|
||||||
@@ -45,6 +47,14 @@ export default {
|
|||||||
request.headers[index].value = value
|
request.headers[index].value = value
|
||||||
},
|
},
|
||||||
|
|
||||||
|
setActiveHeader({ request }, { index, value }) {
|
||||||
|
if (!request.headers[index].hasOwnProperty("active")) {
|
||||||
|
Vue.set(request.headers[index], "active", value)
|
||||||
|
} else {
|
||||||
|
request.headers[index].active = value
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
addParams({ request }, value) {
|
addParams({ request }, value) {
|
||||||
request.params.push(value)
|
request.params.push(value)
|
||||||
},
|
},
|
||||||
@@ -65,6 +75,14 @@ export default {
|
|||||||
request.params[index].type = value
|
request.params[index].type = value
|
||||||
},
|
},
|
||||||
|
|
||||||
|
setActiveParams({ request }, { index, value }) {
|
||||||
|
if (!request.params[index].hasOwnProperty("active")) {
|
||||||
|
Vue.set(request.params[index], "active", value)
|
||||||
|
} else {
|
||||||
|
request.params[index].active = value
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
addBodyParams({ request }, value) {
|
addBodyParams({ request }, value) {
|
||||||
request.bodyParams.push(value)
|
request.bodyParams.push(value)
|
||||||
},
|
},
|
||||||
@@ -81,6 +99,14 @@ export default {
|
|||||||
request.bodyParams[index].value = value
|
request.bodyParams[index].value = value
|
||||||
},
|
},
|
||||||
|
|
||||||
|
setActiveBodyParams({ request }, { index, value }) {
|
||||||
|
if (!request.bodyParams[index].hasOwnProperty("active")) {
|
||||||
|
Vue.set(request.bodyParams[index], "active", value)
|
||||||
|
} else {
|
||||||
|
request.bodyParams[index].active = value
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
setOAuth2({ oauth2 }, { attribute, value }) {
|
setOAuth2({ oauth2 }, { attribute, value }) {
|
||||||
oauth2[attribute] = value
|
oauth2[attribute] = value
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user