Skip to content

Commit 99b055d

Browse files
committed
Fix events not being created bug
1 parent 5570acf commit 99b055d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

course-matrix/frontend/src/pages/TimetableBuilder/Calendar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ const Calendar = React.memo<CalendarProps>(
236236
return;
237237
}
238238
// Create course events for the newly created timetable
239-
const newTimetableId = data?.id;
239+
const newTimetableId = data[0].id;
240240
for (const offeringId of newOfferingIds) {
241241
const { error: offeringError } = await createEvent({
242242
calendar_id: newTimetableId,

course-matrix/frontend/src/pages/TimetableBuilder/GeneratedCalendars.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export const GeneratedCalendars = React.memo<GeneratedCalendarsProps>(
133133
return;
134134
}
135135
// Create course events for the newly created timetable
136-
const newTimetableId = data?.id;
136+
const newTimetableId = data[0].id;
137137
for (const offering of currentTimetableOfferings) {
138138
const offeringId = offering.id;
139139
const { error: offeringError } = await createEvent({

0 commit comments

Comments
 (0)