This commit is contained in:
2026-01-20 02:02:20 +01:00
parent 8e6248cea1
commit 06dddedef6
3 changed files with 36 additions and 15 deletions

View File

@@ -156,6 +156,9 @@
// NEU: Generische Fetch-Funktion für jeden Ressourcentyp ('kind')
    B.fetchResource = (kind) => {
        if (B.USE_DYNAMIC_SECTIONS && ['templates','sections','blocks','snippets'].includes(String(kind || '').toLowerCase())) {
            return Promise.resolve([]);
        }
        if (!shouldLoad(kind)) {
            log('BLOCKED', `Blockiert: ${kind} (Modus: ${B.EDITOR_MODE})`, '#708090', 'info');
            return Promise.resolve([]);
@@ -183,7 +186,10 @@
const loadDynamic = async () => {
const sections = await resolveAllowedSections();
B.ALLOWED_SECTION_SLUGS = sections.map(s => String(s.slug || '').toLowerCase());
if (!sections.length) return [];
if (!sections.length) {
bm.remove(PLACEHOLDER_ID);
return [];
}
const promises = sections.map(section =>
fetchData('content', 'list', { section_id: section.id })
.then(items => (Array.isArray(items) ? items : []).map(i => ({
@@ -209,6 +215,7 @@
 
if (filtered.length === 0) {
log('NO DATA', 'Keine API-Daten gefunden.', 'orange', 'warn', true);
bm.remove(PLACEHOLDER_ID);
} else {
filtered.forEach(item => {
const blockId = `lib-${item.kind}-${item.id}`;