Skip to content

Commit

Permalink
fix: change event dates
Browse files Browse the repository at this point in the history
  • Loading branch information
Morphclue committed May 5, 2024
1 parent 14bf228 commit 831577b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/backend/src/poll/poll/poll.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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();
}

Expand Down

0 comments on commit 831577b

Please sign in to comment.