diff --git a/apps/backend/src/poll/poll/poll.service.ts b/apps/backend/src/poll/poll/poll.service.ts index 410dd7c0..8547055e 100644 --- a/apps/backend/src/poll/poll/poll.service.ts +++ b/apps/backend/src/poll/poll/poll.service.ts @@ -235,7 +235,7 @@ export class PollService implements OnModuleInit { if (!oldEvent) { return false; } - return oldEvent.start.valueOf() !== event.start.valueOf() || oldEvent.end.valueOf() !== event.end.valueOf(); + return oldEvent.start.valueOf() !== new Date(event.start).valueOf() || oldEvent.end.valueOf() !== new Date(event.end).valueOf(); }); if (updatedEvents.length > 0) { for (const event of updatedEvents) { @@ -398,7 +398,7 @@ export class PollService implements OnModuleInit { $or: events.map(e => ({['selection.' + e._id]: {$exists: true}})), }; await this.participantModel.updateMany(filter, { - $unset: events.map(e => 'selection.' + e._id), + $unset: events.reduce((acc, e) => ({...acc, ['selection.' + e._id]: ''}), {}) }, {timestamps: false}).exec(); }