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:
@@ -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(),
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user