diff options
Diffstat (limited to 'hooks/convertPoll.ts')
-rw-r--r-- | hooks/convertPoll.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hooks/convertPoll.ts b/hooks/convertPoll.ts index b4f8376..4da25c1 100644 --- a/hooks/convertPoll.ts +++ b/hooks/convertPoll.ts @@ -19,7 +19,7 @@ export default async (context: HookContext): Promise<HookContext> => { { $group: { _id: '$which', total: { $sum: 1 } } } ]).then(groups => groups.reduce( (acc, group) => _.set(acc, group._id + '.votes', group.total), - {} + { left: { votes: 0 }, right: { votes: 0 } } )); const userChoice = await VoteModel.findOne({ pollId: poll._id, userId: user?._id }); |