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 b11e4bd2df
commit 94041176d4
2 changed files with 10 additions and 3 deletions

View File

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

View File

@ -145,6 +145,15 @@
url = buildUrl(query.fields.path, breakQs)
schema = schemaToFields(query.schema)
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)
if (query && !query.transformer) {
query.transformer = "return data"