aboutsummaryrefslogtreecommitdiff
path: root/models/polls
diff options
context:
space:
mode:
Diffstat (limited to 'models/polls')
-rw-r--r--models/polls/poll.schema.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/models/polls/poll.schema.ts b/models/polls/poll.schema.ts
index 79036c3..ea91051 100644
--- a/models/polls/poll.schema.ts
+++ b/models/polls/poll.schema.ts
@@ -1,18 +1,23 @@
import { Document, Schema, Types } from 'mongoose';
+import { User } from '../users/user.schema'
interface ImageData {
url: string;
votes: number;
}
-export interface PollSchema extends Document {
- authorId: string;
+export interface Poll {
+ author: User;
contents: {
left: ImageData;
right: ImageData;
};
}
+export interface PollSchema extends Document, Omit<Poll, 'author'> {
+ authorId: string;
+}
+
const imageDataSchema = {
url: String,