Löschen/Deaktivierung

This commit is contained in:
2026-02-01 01:34:05 +01:00
parent 1709ae6551
commit 57dc40fd46
4 changed files with 145 additions and 30 deletions

View File

@@ -1062,7 +1062,10 @@ export function initEditor() {
async function confirmTemplateReferences(actionLabel) {
if (!current?.section?.is_template || !current?.id) return true;
const res = await apiAction('templates.references', { method: 'GET', data: { template_id: current.id } }).catch(() => ({}));
const res = await apiAction('templates.references', { method: 'GET', data: { template_id: current.id } }).catch(() => null);
if (!res || res.ok === false) {
return confirm(`Referenzen konnten nicht geprüft werden. ${actionLabel} trotzdem?`);
}
const refs = Array.isArray(res?.references) ? res.references : [];
if (!refs.length) return true;
const preview = refs.slice(0, 6).map(r => `${r.name || 'Template'} #${r.id}`).join(', ');