From 80e5645a84cc60d76f79c48a3d565fb66ad88643 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 18 Jun 2018 09:54:53 +0900 Subject: wip --- src/models/note.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/models/note.ts') diff --git a/src/models/note.ts b/src/models/note.ts index 83e85f8498..83cd93353b 100644 --- a/src/models/note.ts +++ b/src/models/note.ts @@ -1,5 +1,5 @@ import * as mongo from 'mongodb'; -import * as deepcopy from 'deepcopy'; +const deepcopy = require('deepcopy'); import rap from '@prezzemolo/rap'; import db from '../db/mongodb'; import { IUser, pack as packUser } from './user'; @@ -37,7 +37,11 @@ export type INote = { mediaIds: mongo.ObjectID[]; replyId: mongo.ObjectID; renoteId: mongo.ObjectID; - poll: any; // todo + poll: { + choices: Array<{ + id: number; + }> + }; text: string; tags: string[]; tagsLower: string[]; @@ -304,7 +308,7 @@ export const pack = async ( if (vote != null) { const myChoice = poll.choices - .filter(c => c.id == vote.choice)[0]; + .filter((c: any) => c.id == vote.choice)[0]; myChoice.isVoted = true; } -- cgit v1.2.3-freya