assdasd
This commit is contained in:
@@ -172,7 +172,14 @@
|
||||
B.fetchSections = () => B.fetchResource('sections');
|
||||
B.fetchBlocks = () => B.fetchResource('blocks');
|
||||
|
||||
B.getApiItem = (kind, id) => fetchData(kind, 'get', { id: id });
|
||||
B.getApiItem = (kind, id) => {
|
||||
const normalized = String(kind || '').toLowerCase();
|
||||
const legacyKinds = ['templates', 'sections', 'blocks', 'snippets', 'content', 'sections_config', 'content_versions'];
|
||||
if (B.USE_DYNAMIC_SECTIONS && !legacyKinds.includes(normalized)) {
|
||||
return fetchData('content', 'get', { id: id, section_slug: normalized, active_only: 1 });
|
||||
}
|
||||
return fetchData(normalized || kind, 'get', { id: id });
|
||||
};
|
||||
|
||||
B.clearApiCache = () => {
|
||||
B.ApiItemCache = {}; // Cache leeren
|
||||
|
||||
Reference in New Issue
Block a user