feat(api): Zeitraum und Eingang als Pflichtparameter für AnalogInputs-API eingeführt

- API-Handler für /api/cpl/getAnalogInputsHistory überarbeitet
- `zeitraum` (DIA0, DIA1, DIA2) und `eingang` (1–8) sind jetzt Pflichtfelder
- Bei fehlenden oder ungültigen Parametern strukturierte Fehlerantwort mit Beispielen
- Daten werden nun gezielt pro Eingang und Zeitraum geladen (z. B. AE3 + DIA1)
- Bessere Fehlerbehandlung bei nicht vorhandenen Dateien
This commit is contained in:
ISA
2025-07-11 11:50:56 +02:00
parent 2d3e070830
commit ca84ac6bb5
9 changed files with 19 additions and 13 deletions

View File

@@ -5,8 +5,6 @@ import fs from "fs";
import path from "path";
export default function handler(req: NextApiRequest, res: NextApiResponse) {
const mode = process.env.NEXT_PUBLIC_CPL_MODE;
try {
const filePath = path.join(
process.cwd(),

View File

@@ -8,8 +8,6 @@ export default async function handler(
req: NextApiRequest,
res: NextApiResponse
) {
const mode = process.env.NEXT_PUBLIC_CPL_MODE ?? "json";
// Lese JSON-Datei z.B. digitalOutputsMockData.json
const filePath = path.join(
process.cwd(),

View File

@@ -8,7 +8,6 @@ export default function handler(req: NextApiRequest, res: NextApiResponse) {
return res.status(405).json({ error: "Method not allowed" });
}
const mode = process.env.NEXT_PUBLIC_CPL_MODE;
const updates = req.body.updates;
if (!Array.isArray(updates)) {