Update CSV data fetching to use API endpoint in Mannschaften components
Some checks failed
Code Analysis (JS/Vue) / analyze (push) Failing after 5s

This commit modifies the loadMannschaften function across multiple components to fetch CSV data from the new API endpoint '/api/mannschaften' instead of the previous static file path '/data/mannschaften.csv'. This change enhances data retrieval consistency and aligns with the updated data management strategy in the application.
This commit is contained in:
Torsten Schulz (local)
2026-01-19 08:28:43 +01:00
parent 27312cc118
commit c39e5de29f
6 changed files with 63 additions and 5 deletions

View File

@@ -125,7 +125,7 @@ async function fetchCsvText(url) {
const loadMannschaften = async () => {
try {
const csv = await fetchCsvText('/data/mannschaften.csv')
const csv = await fetchCsvText('/api/mannschaften')
// Vereinfachter CSV-Parser
const lines = csv.split('\n').filter(line => line.trim() !== '')

View File

@@ -924,7 +924,7 @@ const toggleMobileSubmenu = (menu) => {
const loadMannschaften = async () => {
try {
const attempt = async () => {
const url = `/data/mannschaften.csv?_t=${Date.now()}`
const url = `/api/mannschaften?_t=${Date.now()}`
const response = await fetch(url, { cache: 'no-store' })
if (!response.ok) return null
return await response.text()