diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-02-04 14:52:33 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-02-04 14:52:33 +0900 |
| commit | bcd65d290d25219631bb47570478378a698d0fa0 (patch) | |
| tree | de3630065fcddeb1916668ef3b0b43a219340e2e /src/api/endpoints/posts | |
| parent | wip (diff) | |
| download | sharkey-bcd65d290d25219631bb47570478378a698d0fa0.tar.gz sharkey-bcd65d290d25219631bb47570478378a698d0fa0.tar.bz2 sharkey-bcd65d290d25219631bb47570478378a698d0fa0.zip | |
wip
Diffstat (limited to 'src/api/endpoints/posts')
| -rw-r--r-- | src/api/endpoints/posts/reactions/create.ts | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/api/endpoints/posts/reactions/create.ts b/src/api/endpoints/posts/reactions/create.ts index d537463dfe..0b0e0e294d 100644 --- a/src/api/endpoints/posts/reactions/create.ts +++ b/src/api/endpoints/posts/reactions/create.ts @@ -3,13 +3,12 @@ */ import $ from 'cafy'; import Reaction from '../../../models/post-reaction'; -import Post from '../../../models/post'; +import Post, { pack as packPost } from '../../../models/post'; +import { pack as packUser } from '../../../models/user'; import Watching from '../../../models/post-watching'; import notify from '../../../common/notify'; import watch from '../../../common/watch-post'; import { publishPostStream, pushSw } from '../../../event'; -import serializePost from '../../../serializers/post'; -import serializeUser from '../../../serializers/user'; /** * React to a post @@ -90,8 +89,8 @@ module.exports = (params, user) => new Promise(async (res, rej) => { }); pushSw(post.user_id, 'reaction', { - user: await serializeUser(user, post.user_id), - post: await serializePost(post, post.user_id), + user: await packUser(user, post.user_id), + post: await packPost(post, post.user_id), reaction: reaction }); |