This commit is contained in:
syuilo 2018-02-02 08:21:30 +09:00
parent 9a282e37be
commit 718060dc85
61 changed files with 132 additions and 119 deletions

View file

@ -4,7 +4,7 @@
import $ from 'cafy';
import Post from '../../models/post';
import User from '../../models/user';
import serialize from '../../serializers/user';
import { pack } from '../../models/user';
module.exports = (params, me) => new Promise(async (res, rej) => {
// Get 'user_id' parameter
@ -91,7 +91,7 @@ module.exports = (params, me) => new Promise(async (res, rej) => {
// Make replies object (includes weights)
const repliesObj = await Promise.all(topRepliedUsers.map(async (user) => ({
user: await serialize(user, me, { detail: true }),
user: await pack(user, me, { detail: true }),
weight: repliedUsers[user] / peak
})));