From d5c891244b9438d0ed59b73c792ce13467e1e2ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 10 May 2026 00:09:37 +0200 Subject: [PATCH] fix(export-section): point download buttons at the new plain-segment endpoints MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The four `/api/export/*` route handlers landed under plain segments (`/api/export/measurements` instead of `/api/export/measurements.csv`) because vitest's resolver chokes on dotted route segments. The `` component still pointed at the old dotted paths — which 404'd in the browser even though the routes themselves were healthy. Realign the four endpoint URLs so the consolidated Settings → Export UI actually downloads. Filename + Content-Disposition still carry the `.csv` / `.json` extension so the browser writes a correctly-named file. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/components/settings/export-section.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/settings/export-section.tsx b/src/components/settings/export-section.tsx index 7bb34f49e..ae5eae283 100644 --- a/src/components/settings/export-section.tsx +++ b/src/components/settings/export-section.tsx @@ -383,7 +383,7 @@ function MeasurementsCsvCard() { icon={FileSpreadsheet} titleKey="settings.sections.export.cards.measurementsCsv.title" descriptionKey="settings.sections.export.cards.measurementsCsv.description" - endpoint="/api/export/measurements.csv" + endpoint="/api/export/measurements" filenamePrefix="healthlog-measurements" /> ); @@ -410,7 +410,7 @@ function MedicationsCsvCard() { }); const stamp = new Date().toISOString().slice(0, 10); await downloadFromUrl( - `/api/export/medications.csv${query}`, + `/api/export/medications${query}`, `healthlog-medications-${stamp}.csv`, ); } catch (err) { @@ -482,7 +482,7 @@ function MoodCsvCard() { icon={Waves} titleKey="settings.sections.export.cards.moodCsv.title" descriptionKey="settings.sections.export.cards.moodCsv.description" - endpoint="/api/export/mood.csv" + endpoint="/api/export/mood" filenamePrefix="healthlog-mood" /> ); @@ -499,7 +499,7 @@ function FullBackupCard() { try { const stamp = new Date().toISOString().slice(0, 10); await downloadFromUrl( - "/api/export/full-backup.json", + "/api/export/full-backup", `healthlog-backup-${stamp}.json`, ); } catch (err) {