yyc
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user