From 4635f59d7c3fea4b97029f10886c62fdf38b2084 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 27 Dec 2017 16:11:53 +0100 Subject: Add video comment components --- server/controllers/api/videos/comment.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'server/controllers/api/videos') diff --git a/server/controllers/api/videos/comment.ts b/server/controllers/api/videos/comment.ts index e9dbb6d1b..276948098 100644 --- a/server/controllers/api/videos/comment.ts +++ b/server/controllers/api/videos/comment.ts @@ -66,9 +66,7 @@ async function addVideoCommentThreadRetryWrapper (req: express.Request, res: exp const comment = await retryTransactionWrapper(addVideoCommentThread, options) res.json({ - comment: { - id: comment.id - } + comment: comment.toFormattedJSON() }).end() } @@ -80,7 +78,7 @@ function addVideoCommentThread (req: express.Request, res: express.Response) { text: videoCommentInfo.text, inReplyToComment: null, video: res.locals.video, - accountId: res.locals.oauth.token.User.Account.id + account: res.locals.oauth.token.User.Account }, t) }) } @@ -94,9 +92,7 @@ async function addVideoCommentReplyRetryWrapper (req: express.Request, res: expr const comment = await retryTransactionWrapper(addVideoCommentReply, options) res.json({ - comment: { - id: comment.id - } + comment: comment.toFormattedJSON() }).end() } @@ -108,7 +104,7 @@ function addVideoCommentReply (req: express.Request, res: express.Response, next text: videoCommentInfo.text, inReplyToComment: res.locals.videoComment, video: res.locals.video, - accountId: res.locals.oauth.token.User.Account.id + account: res.locals.oauth.token.User.Account }, t) }) } -- cgit v1.2.3