This commit is contained in:
2025-12-07 01:07:20 +01:00
parent 14d307da3a
commit cd9c9e3680

View File

@@ -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;
}