Implement category tree via AJAX to avoid 500 errors on page load

This commit is contained in:
2025-11-12 08:47:52 +01:00
parent 953f831ab9
commit deb27490c2
5 changed files with 78 additions and 1 deletions

View File

@@ -115,6 +115,16 @@ document.addEventListener('DOMContentLoaded', function() {
const initialPath = window.location.pathname === '/' ? '/items' : window.location.pathname;
fetchContent(initialPath, false);
// Load category tree
fetch('/api/tree')
.then(response => response.text())
.then(html => {
document.querySelector('.sidebar').innerHTML = html;
})
.catch(error => {
console.error('Error loading tree:', error);
});
// Page-specific scripts (e.g., form submissions)
function initPageSpecificScripts() {
// Overview page: filter form