From cd9c9e3680c4b35863c393606bc47794c98a1344 Mon Sep 17 00:00:00 2001 From: Lars Gebhardt-Kusche Date: Sun, 7 Dec 2025 01:07:20 +0100 Subject: [PATCH] yyc --- public/assets/js/ui-list.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/public/assets/js/ui-list.js b/public/assets/js/ui-list.js index c5dae63..f76c06e 100644 --- a/public/assets/js/ui-list.js +++ b/public/assets/js/ui-list.js @@ -17,11 +17,13 @@ async function openSnippetEditor(id){ const btnCancel = document.getElementById('editSnippetCancel'); // Daten laden - let row = {}; - try { row = await apiGet('snippets', id) || {}; } catch(e){} + let resp = {}; + try { resp = await apiGet('snippets', id) || {}; } catch(e){} + const row = resp?.item || resp?.data || resp || {}; + const contentValue = resp?.content ?? row.content ?? ''; if (inpName) inpName.value = row.name || ''; - if (taContent) taContent.value = row.content || ''; + if (taContent) taContent.value = contentValue; function cleanup(){ form && form.removeEventListener('submit', onSubmit); @@ -167,4 +169,3 @@ export function initLists(){ // Backwards compat (falls woanders genutzt) window.loadList = loadList; } -