feat: Active toggle for GraphQL headers

This commit is contained in:
Liyas Thomas
2021-01-08 21:55:31 +05:30
parent 01a45f3085
commit 0a39e7b02f
2 changed files with 54 additions and 10 deletions

View File

@@ -87,6 +87,36 @@
autofocus
/>
</li>
<div>
<li>
<button
class="icon"
@click="
$store.commit('setActiveGQLHeader', {
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
@@ -627,9 +657,11 @@ export default {
try {
let headers = {}
this.headers.forEach(({ key, value }) => {
headers[key] = value
})
this.headers
.filter((item) => (item.hasOwnProperty("active") ? item.active == true : true))
.forEach(({ key, value }) => {
headers[key] = value
})
let variables = JSON.parse(this.variableString || "{}")
@@ -738,9 +770,11 @@ export default {
})
let headers = {}
this.headers.forEach(({ key, value }) => {
headers[key] = value
})
this.headers
.filter((item) => (item.hasOwnProperty("active") ? item.active == true : true))
.forEach(({ key, value }) => {
headers[key] = value
})
const reqOptions = {
method: "post",
@@ -806,9 +840,11 @@ export default {
})
let headers = {}
this.headers.forEach(({ key, value }) => {
headers[key] = value
})
this.headers
.filter((item) => (item.hasOwnProperty("active") ? item.active == true : true))
.forEach(({ key, value }) => {
headers[key] = value
})
const reqOptions = {
method: "post",