From 4101b4ff7a5c328164fe74ebfa3c42b82f332c43 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Mon, 22 Jun 2020 21:12:07 +0300 Subject: fix: get rid of poll.vote function --- models/polls/poll.model.ts | 5 ----- 1 file changed, 5 deletions(-) (limited to 'models/polls/poll.model.ts') diff --git a/models/polls/poll.model.ts b/models/polls/poll.model.ts index 6f3d088..7f6be9a 100644 --- a/models/polls/poll.model.ts +++ b/models/polls/poll.model.ts @@ -1,10 +1,5 @@ import { Model, model } from 'mongoose'; import { PollSchema, pollSchema } from './poll.schema'; -pollSchema.methods.vote = function(userId: string, which: 'left' | 'right'): PollSchema { - this.contents[which].votes.push(userId); - return this.save(); -} - export default model>('Poll', pollSchema); -- cgit v1.2.3