summaryrefslogtreecommitdiff
path: root/src/api/endpoints/posts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-02-04 14:52:33 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-02-04 14:52:33 +0900
commitbcd65d290d25219631bb47570478378a698d0fa0 (patch)
treede3630065fcddeb1916668ef3b0b43a219340e2e /src/api/endpoints/posts
parentwip (diff)
downloadsharkey-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.ts9
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
});