diff options
author | ilyayudovin <ilyayudovin123@gmail.com> | 2020-06-21 13:10:05 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-06-21 13:13:27 +0300 |
commit | f4c4f2d4789880c0cfc956d08aab10b5a93ebcb1 (patch) | |
tree | de24c4c3ede7d0df755aebbba8cadbf6169d1b0d /models | |
parent | 29dce80de9267a4886c6a598ec90756995821828 (diff) | |
download | which-api-f4c4f2d4789880c0cfc956d08aab10b5a93ebcb1.tar.gz |
feat: change votes type
Diffstat (limited to 'models')
-rw-r--r-- | models/polls/poll.schema.ts | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/models/polls/poll.schema.ts b/models/polls/poll.schema.ts index bc6d497..236011f 100644 --- a/models/polls/poll.schema.ts +++ b/models/polls/poll.schema.ts @@ -7,6 +7,7 @@ export interface ImageData { } export interface Poll { + _id: string; author: User; contents: { left: ImageData; @@ -14,14 +15,22 @@ export interface Poll { }; } -export interface PollSchema extends Document, Omit<Poll, 'author'> { - authorId: string; +export interface ImageDataSchema { + url: string; + votes: string[]; } +export interface PollSchema extends Document { + contents: { + left: ImageDataSchema; + right: ImageDataSchema; + }; + authorId: string; +} -const imageDataSchema = { +export const imageDataSchema = { url: String, - votes: Number + votes: [Types.ObjectId] }; export const pollSchema = new Schema({ |