fix es lint ignore

This commit is contained in:
ISA
2025-06-27 12:20:19 +02:00
parent 1f11cf68ac
commit 71c74d8d66
7 changed files with 25 additions and 11 deletions

View File

@@ -32,17 +32,24 @@ export default function handler(req: NextApiRequest, res: NextApiResponse) {
const fileContent = fs.readFileSync(filePath, "utf-8");
const jsonData = JSON.parse(fileContent);
interface SlotDataEntry {
t: string;
[key: string]: unknown;
}
const fromDateStr = String(vonDatum);
const toDateStr = String(bisDatum);
const filtered = jsonData.filter((entry: any) => {
if (!entry.t) return false;
const dateStr = entry.t.split(" ")[0]; // Nur yyyy-mm-dd extrahieren
return dateStr >= fromDateStr && dateStr <= toDateStr;
});
const filtered = (jsonData as SlotDataEntry[]).filter(
(entry: SlotDataEntry) => {
if (!entry.t) return false;
const dateStr = entry.t.split(" ")[0]; // Nur yyyy-mm-dd extrahieren
return dateStr >= fromDateStr && dateStr <= toDateStr;
}
);
res.status(200).json(filtered);
} catch (error: any) {
} catch (error: unknown) {
console.error("❌ Fehler beim Lesen der Slot-Daten:", error);
res.status(500).json({ error: "❌ Interner Serverfehler" });
}