From fe529f4a7739ac6dd9a30652279818519565ec6a Mon Sep 17 00:00:00 2001 From: eug-vs Date: Thu, 25 Jun 2020 18:52:01 +0300 Subject: style!: fix all linting errors --- hooks/convertPoll.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'hooks') 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 => { { $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 } } )); -- cgit v1.2.3