1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-21 09:55:28 +02:00

Fix NoteReaction (#4547)

This commit is contained in:
MeiMei
2019-03-20 21:39:02 +09:00
committed by syuilo
parent 1d7933349b
commit 1c79e30436
4 changed files with 9 additions and 10 deletions

View File

@@ -2,7 +2,6 @@ import * as mongo from 'mongodb';
import * as deepcopy from 'deepcopy';
import db from '../db/mongodb';
import isObjectId from '../misc/is-objectid';
import Reaction from './note-reaction';
import { pack as packUser } from './user';
const NoteReaction = db.get<INoteReaction>('noteReactions');
@@ -30,11 +29,11 @@ export const pack = (
// Populate the reaction if 'reaction' is ID
if (isObjectId(reaction)) {
_reaction = await Reaction.findOne({
_reaction = await NoteReaction.findOne({
_id: reaction
});
} else if (typeof reaction === 'string') {
_reaction = await Reaction.findOne({
_reaction = await NoteReaction.findOne({
_id: new mongo.ObjectID(reaction)
});
} else {