/* * Welcome to your app's main JavaScript file! * * This file will be included onto the page via the importmap() Twig function, * which should already be in your base.html.twig. */ import './styles/app.css'; function filterCasesByUser(userId) { fetch('/index.php/api/filter-cases-by-user', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ userId: userId }) }) .then(response => response.json()) .then(data => { const caseList = document.getElementById('case-list'); caseList.innerHTML = ''; data.forEach(c => { caseList.innerHTML += `