From 68725af6303842027446ee6ed77b559532271c9a Mon Sep 17 00:00:00 2001 From: Torsten Schulz Date: Tue, 15 Jul 2025 16:22:14 +0200 Subject: [PATCH] Fixed UTF8 import --- backend/services/matchService.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/backend/services/matchService.js b/backend/services/matchService.js index 3bb3deb..ffb0aab 100644 --- a/backend/services/matchService.js +++ b/backend/services/matchService.js @@ -31,7 +31,7 @@ class MatchService { const matches = []; try { const fileStream = fs.createReadStream(filePath) - .pipe(iconv.decodeStream('ISO-8859-15')) + .pipe(iconv.decodeStream('utf8')) .pipe(csv({ separator: ';' })); for await (const row of fileStream) { const parsedDate = parse(row['Termin'], 'dd.MM.yyyy HH:mm', new Date()); @@ -67,15 +67,11 @@ class MatchService { clubId: clubId, }); } + let season = null; if (seasonString) { - const season = await Season.findOne({ where: { season: seasonString } }); + season = await Season.findOne({ where: { season: seasonString } }); if (season) { - await Match.destroy({ - where: { - clubId: clubId, - seasonId: season.id, - } - }); + await Match.destroy({ where: { clubId, seasonId: season.id } }); } } const result = await Match.bulkCreate(matches);