Fixing issue of disabled headers not being set for unmigrated queries.

This commit is contained in:
mike12345567 2021-12-13 15:18:44 +00:00
parent b19fcb5d50
commit 1670c31ba7
2 changed files with 10 additions and 3 deletions

View File

@ -41,9 +41,7 @@
for (let [key, value] of Object.entries(obj)) { for (let [key, value] of Object.entries(obj)) {
const field = fields.find(el => el.name === key) const field = fields.find(el => el.name === key)
const idx = fields.indexOf(field) const idx = fields.indexOf(field)
if (idx !== -1) { array[idx] = idx !== -1 ? value : true
array[idx] = value
}
} }
return array return array
} }

View File

@ -145,6 +145,15 @@
url = buildUrl(query.fields.path, breakQs) url = buildUrl(query.fields.path, breakQs)
schema = schemaToFields(query.schema) schema = schemaToFields(query.schema)
bindings = queryParametersToKeyValue(query.parameters) bindings = queryParametersToKeyValue(query.parameters)
if (!query.fields.disabledHeaders) {
query.fields.disabledHeaders = {}
}
// make sure the disabled headers are set (migration)
for (let header of Object.keys(query.fields.headers)) {
if (!query.fields.disabledHeaders[header]) {
query.fields.disabledHeaders[header] = false
}
}
enabledHeaders = flipHeaderState(query.fields.disabledHeaders) enabledHeaders = flipHeaderState(query.fields.disabledHeaders)
if (query && !query.transformer) { if (query && !query.transformer) {
query.transformer = "return data" query.transformer = "return data"