mirror of
https://github.com/ae-utbm/sith.git
synced 2026-10-05 18:34:15 +00:00
api to save timetable
This commit is contained in:
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user