diff --git a/src/models/dhbw-rapla-changes/changes/changes.service.ts b/src/models/dhbw-rapla-changes/changes/changes.service.ts index b58ace1..54c38bd 100644 --- a/src/models/dhbw-rapla-changes/changes/changes.service.ts +++ b/src/models/dhbw-rapla-changes/changes/changes.service.ts @@ -25,6 +25,10 @@ export const getChanges = async (course: string, week: string): Promise relevantEventIds.push(row.entry_id); }); + if (relevantEventIds.length < 1) { + return []; + } + let rows = await conn.query('SELECT c.change_id, c.entry_id, c.change_timestamp, c.isDeleted, c.new_summary, c.new_description, c.new_start, c.new_last_modified, c.new_end, c.new_created, c.new_location, c.new_organizer, c.new_categories, e.uid FROM rapla_changes c LEFT OUTER JOIN rapla_entries e ON c.entry_id = e.entry_id WHERE c.entry_id IN (?) ORDER BY c.change_id', [relevantEventIds]); let eventsMap = new Map();