API-29: Fixing bug where event latest_start_date would be null for deleted events
All checks were successful
Jenkins Production Deployment

This commit is contained in:
Patrick Müller 2021-09-30 14:44:49 +02:00
parent 558d076537
commit 600abd16dd

View File

@ -54,8 +54,11 @@ export const getChanges = async (course: string, week: string): Promise<Event[]>
if (eventsMap.has(row.entry_id)) {
let event = eventsMap.get(row.entry_id);
event.latest_event_summary = row.new_summary;
event.latest_start_date = row.new_start;
// Only adjust these fields if the event is not deleted as otherwise they would be null
if (!row.isDeleted) {
event.latest_event_summary = row.new_summary;
event.latest_start_date = row.new_start;
}
event.changes.push(change);
eventsMap.set(row.entry_id, event);