Mock daten für DIA0, DIA1 und DIA2 für KÜs-Charts
This commit is contained in:
@@ -30,18 +30,20 @@ const LoopChartActionBar: React.FC = () => {
|
||||
* @param mode - DIA0, DIA1 oder DIA2
|
||||
* @param slotIndex - Slot für die Abfrage
|
||||
*/
|
||||
const getApiUrl = (mode: "DIA0" | "DIA1" | "DIA2") => {
|
||||
const getApiUrl = (mode: "DIA0" | "DIA1" | "DIA2", type: number) => {
|
||||
return process.env.NODE_ENV === "development"
|
||||
? `/CPLmockData/kuesChartData/${mode}.json`
|
||||
: `/CPL?seite.ACP&${mode}=${vonDatum};${bisDatum};${slotIndex}`;
|
||||
? `/CPLmockData/kuesChartData/${mode}_${type}.json`
|
||||
: `/CPL?seite.ACP&${mode}=${vonDatum};${bisDatum};${type}`;
|
||||
};
|
||||
|
||||
/**
|
||||
* Funktion zum Laden der Messwerte
|
||||
*/
|
||||
const handleFetchData = async () => {
|
||||
const type = selectedSlotType === "schleifenwiderstand" ? 4 : 3; // 4 für Schleifenwiderstand, 3 für Isolationswiderstand
|
||||
|
||||
try {
|
||||
const apiUrl = getApiUrl(selectedMode);
|
||||
const apiUrl = getApiUrl(selectedMode, type);
|
||||
console.log("Mock JSON laden von:", apiUrl);
|
||||
|
||||
const response = await fetch(apiUrl);
|
||||
|
||||
Reference in New Issue
Block a user