fix es lint ignore
This commit is contained in:
@@ -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" });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user