diff options
author | eug-vs <eug-vs@keemail.me> | 2020-06-25 18:52:01 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-06-25 18:52:01 +0300 |
commit | fe529f4a7739ac6dd9a30652279818519565ec6a (patch) | |
tree | 15bb089fb7f8342c1ee63e3a7efa8834b578db3e /hooks | |
parent | 0afe8f1530affad1e58a65385b2a4bf888ab86cb (diff) | |
download | which-api-fe529f4a7739ac6dd9a30652279818519565ec6a.tar.gz |
style!: fix all linting errors
Diffstat (limited to 'hooks')
-rw-r--r-- | hooks/convertPoll.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hooks/convertPoll.ts b/hooks/convertPoll.ts index 1c32851..5e6f9f4 100644 --- a/hooks/convertPoll.ts +++ b/hooks/convertPoll.ts @@ -2,7 +2,7 @@ import { HookContext } from '@feathersjs/feathers'; import { Types } from 'mongoose'; import bluebird from 'bluebird'; import _ from 'lodash'; -import { Poll, User, Vote } from 'which-types'; +import { Poll } from 'which-types'; import { PollSchema } from '../models/polls/poll.schema'; import VoteModel from '../models/votes/vote.model'; @@ -18,7 +18,7 @@ export default async (context: HookContext): Promise<HookContext> => { { $match: { pollId: Types.ObjectId(poll._id) } }, { $group: { _id: '$which', total: { $sum: 1 } } } ]).then(groups => groups.reduce( - (acc, group) => _.set(acc, group._id + '.votes', group.total), + (acc, group) => _.set(acc, `${group._id}.votes`, group.total), { left: { votes: 0 }, right: { votes: 0 } } )); |