api to save timetable

This commit is contained in:
imperosol committed 2026-10-02 15:35:29 +02:00
1 parent 7044a06546
commit 7a0df3d8a7
3 files changed
+65 -2

No files matched your search

@@ -78,7 +78,7 @@ function parseSlots(s: string): TimetableSlot[] {
document.addEventListener("alpine:init", () => {
Alpine.data("timetableGenerator", () => ({
content: DEFAULT_TIMETABLE,
error: null as { incorrectRow?: string },
error: null as { incorrectRow?: string } | null,
displayedWeekdays: [] as WeekDay[],
courses: [] as TimetableSlot[],
startSlot: 0,
@@ -108,7 +108,8 @@ document.addEventListener("alpine:init", () => {
this.courses = parseSlots(this.content);
this.error = null;
} catch (err) {
this.error = { incorrectRow: err?.cause?.row };
type ParseRowError = { cause: { row: string } };
this.error = { incorrectRow: (err as ParseRowError)?.cause?.row };
return;
}