This commit is contained in:
syuilo
2018-06-18 09:54:53 +09:00
parent a766faeae9
commit 80e5645a84
150 changed files with 305 additions and 2334 deletions

View File

@@ -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;
}