fix plugins members.

This commit is contained in:
Miroslav Šedivý 2024-03-17 15:38:31 +01:00
parent f3a49e7051
commit 93125abfd7

View File

@ -537,22 +537,22 @@ function showPlugins(id: string, profile: ApiModels.MemberProfile) {
} }
} }
function savePlugins() { async function savePlugins() {
if (!plugins.value) return if (!plugins.value) return
let errKey = '' let errKey = ''
try { try {
let plugins = {} as any let p = {} as any
for (let [key, val] of plugins.value.old) { for (let [key, val] of plugins.value.old) {
errKey = key errKey = key
plugins[key] = JSON.parse(val) p[key] = JSON.parse(val)
} }
for (let [key, val] of plugins.value.new) { for (let [key, val] of plugins.value.new) {
errKey = key errKey = key
plugins[key] = JSON.parse(val) p[key] = JSON.parse(val)
} }
updateProfile(plugins.value.id, { plugins }) await updateProfile(plugins.value.id, { plugins: p })
plugins.value = null plugins.value = null
} catch (e: any) { } catch (e: any) {
alert(errKey + ': ' + e) alert(errKey + ': ' + e)