feat: support removing config values via null
This commit is contained in:
parent
9aedd9baad
commit
ea2ffdf0c1
@ -91,9 +91,9 @@ function NameserverList({ isGlobal, isDisabled, nameservers, name }: ListProps)
|
||||
})
|
||||
} else {
|
||||
const key = `dns.nameservers.split."${name}"`
|
||||
const list = nameservers.filter((_, i) => i !== index)
|
||||
submit({
|
||||
[key]: nameservers
|
||||
.filter((_, i) => i !== index),
|
||||
[key]: list.length ? list : null,
|
||||
}, {
|
||||
method: 'PATCH',
|
||||
encType: 'application/json',
|
||||
|
||||
@ -308,6 +308,11 @@ export async function patchConfig(partial: Record<string, unknown>) {
|
||||
|
||||
// Push the remaining element
|
||||
path.push(temp.replaceAll('"', ''))
|
||||
if (value === null) {
|
||||
configYaml.deleteIn(path)
|
||||
continue
|
||||
}
|
||||
|
||||
configYaml.setIn(path, value)
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user