This commit is contained in:
syuilo
2018-05-19 07:33:34 +09:00
parent ddad9da1c1
commit e6eb1b2ae1
36 changed files with 5 additions and 1626 deletions

View File

@ -4,7 +4,6 @@ import rap from '@prezzemolo/rap';
import db from '../db/mongodb';
import { IUser, pack as packUser } from './user';
import { pack as packApp } from './app';
import { pack as packChannel } from './channel';
import PollVote, { deletePollVote } from './poll-vote';
import Reaction, { deleteNoteReaction } from './note-reaction';
import { pack as packFile } from './drive-file';
@ -29,7 +28,6 @@ export function isValidCw(text: string): boolean {
export type INote = {
_id: mongo.ObjectID;
channelId: mongo.ObjectID;
createdAt: Date;
deletedAt: Date;
mediaIds: mongo.ObjectID[];
@ -258,11 +256,6 @@ export const pack = async (
_note.app = packApp(_note.appId);
}
// Populate channel
if (_note.channelId) {
_note.channel = packChannel(_note.channelId);
}
// Populate media
_note.media = hide ? [] : Promise.all(_note.mediaIds.map(fileId =>
packFile(fileId)