fix(export-section): point download buttons at the new plain-segment endpoints

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
`<ExportSection>` 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) <noreply@anthropic.com>
This commit is contained in:
Marc-André BombeckandClaude Opus 4.7 committed 2026-05-10 00:09:37 +02:00
1 parent 4cc3d8d45e
commit d5c891244b
1 file changed
+4 -4
+4 -4
View File
@@ -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) {