From 600abd16dd7a65b3517a1791055ad77e53190233 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20M=C3=BCller?= Date: Thu, 30 Sep 2021 14:44:49 +0200 Subject: [PATCH] API-29: Fixing bug where event latest_start_date would be null for deleted events --- src/models/dhbw-rapla-changes/changes/changes.service.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/models/dhbw-rapla-changes/changes/changes.service.ts b/src/models/dhbw-rapla-changes/changes/changes.service.ts index 54c38bd..3467a13 100644 --- a/src/models/dhbw-rapla-changes/changes/changes.service.ts +++ b/src/models/dhbw-rapla-changes/changes/changes.service.ts @@ -54,8 +54,11 @@ export const getChanges = async (course: string, week: string): Promise 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);