feat: handle class changes

This commit is contained in:
Starcea 2024-06-28 16:35:11 +09:00
commit f04385b6ce
No known key found for this signature in database
GPG key ID: B7A77E32374911E1
3 changed files with 15 additions and 5 deletions

View file

@ -8,6 +8,7 @@ interface Data {
timetableRoute: string
teacherCode: string
originalCode: string
dayCode: string
subjectCode: string
}
@ -37,6 +38,9 @@ export default class DataManager {
const teacher = RegExes.TeacherCode.exec(data)
if (!teacher) throw new Error('Failed to fetch teacher code')
const original = RegExes.OriginalCode.exec(data)
if (!original) throw new Error('Failed to fetch original code')
const day = RegExes.DayCode.exec(data)
if (!day) throw new Error('Failed to fetch day code')
@ -49,6 +53,7 @@ export default class DataManager {
searchRoute: search[0],
timetableRoute: timetable[0],
teacherCode: teacher[0],
originalCode: original[0],
dayCode: day[0],
subjectCode: subject[0],
}