fix(admin/*SaveButton): cast settings to string

This commit is contained in:
Simon Vieille 2026-03-01 13:09:02 +01:00
commit 520225603b
Signed by: deblan
GPG key ID: 579388D585F70417
2 changed files with 4 additions and 4 deletions

View file

@ -73,10 +73,10 @@ const save = async () => {
if (Array.isArray(value) || typeof value === 'object') { if (Array.isArray(value) || typeof value === 'object') {
value = JSON.stringify(value) value = JSON.stringify(value)
} else if (typeof value === 'boolean') { } else if (typeof value === 'boolean') {
value = value ? 1 : 0 value = value ? '1' : '0'
} }
OCP.AppConfig.setValue('side_menu', key, value, { OCP.AppConfig.setValue('side_menu', key, value.toString(), {
success() { success() {
update() update()
}, },

View file

@ -69,11 +69,11 @@ const save = async () => {
if (Array.isArray(value) || typeof value === 'object') { if (Array.isArray(value) || typeof value === 'object') {
value = JSON.stringify(value) value = JSON.stringify(value)
} else if (typeof value === 'boolean') { } else if (typeof value === 'boolean') {
value = value ? 1 : 0 value = value ? '1' : '0'
} }
formData.push('name=' + encodeURIComponent(key)) formData.push('name=' + encodeURIComponent(key))
formData.push('value=' + encodeURIComponent(value)) formData.push('value=' + encodeURIComponent(value.toString()))
fetch(url, { fetch(url, {
method: 'POST', method: 'POST',