feat: API-Route für gefilterte Mock-Daten implementiert
- Neue Route /api/cpl/slotData erstellt - Lädt Daten aus /public/CPLmockData/kuesChartData/... basierend auf slot, messart und dia - Optionales Filtern über vonDatum und bisDatum hinzugefügt - 404-Fehler bei fehlender Datei wird abgefangen
This commit is contained in:
@@ -23,7 +23,8 @@ const getApiUrl = (
|
||||
: "unbekannterTyp";
|
||||
|
||||
return process.env.NEXT_PUBLIC_NODE_ENV === "development"
|
||||
? `/CPLmockData/kuesChartData/slot${slotNumber}/${typeFolder}/${mode}.json`
|
||||
? // ? `/CPLmockData/kuesChartData/slot${slotNumber}/${typeFolder}/${mode}.json`
|
||||
`/api/cpl/slotData?slot=${slotNumber}&messart=${typeFolder}&dia=${mode}&vonDatum=${vonDatum}&bisDatum=${bisDatum}`
|
||||
: `${window.location.origin}/CPL?seite.ACP&${mode}=${formatDate(
|
||||
vonDatum
|
||||
)};${formatDate(bisDatum)};${slotNumber};${type};`;
|
||||
|
||||
Reference in New Issue
Block a user