forked from AkkomaGang/admin-fe
Update config parsing
This commit is contained in:
parent
383397f685
commit
a84cb569a1
1 changed files with 6 additions and 0 deletions
|
@ -22,6 +22,12 @@ const settings = {
|
||||||
const newSettings = data.reduce((acc, { group, key, value }) => {
|
const newSettings = data.reduce((acc, { group, key, value }) => {
|
||||||
if (group === 'cors_plug') {
|
if (group === 'cors_plug') {
|
||||||
acc[':cors_plug'] = { ...acc[':cors_plug'], [key]: value }
|
acc[':cors_plug'] = { ...acc[':cors_plug'], [key]: value }
|
||||||
|
} else if (group === 'logger') {
|
||||||
|
const parsedValue = valueHasTuples(key, value) ? value : parseTuples(value, key)
|
||||||
|
acc[':logger'] = acc[':logger'] ? { ...acc[':logger'], [key]: parsedValue } : { [key]: parsedValue }
|
||||||
|
} else if (group === 'quack') {
|
||||||
|
const parsedValue = valueHasTuples(key, value) ? value : parseTuples(value, key)
|
||||||
|
acc[':quack'] = acc[':quack'] ? { ...acc[':quack'], [key]: parsedValue } : { [key]: parsedValue }
|
||||||
} else {
|
} else {
|
||||||
const parsedValue = valueHasTuples(key, value) ? { value } : parseTuples(value, key)
|
const parsedValue = valueHasTuples(key, value) ? { value } : parseTuples(value, key)
|
||||||
acc[key] = { ...acc[key], ...parsedValue }
|
acc[key] = { ...acc[key], ...parsedValue }
|
||||||
|
|
Loading…
Reference in a new issue