Löschen/Deaktivierung
This commit is contained in:
@@ -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(', ');
|
||||
|
||||
Reference in New Issue
Block a user