MCPcopy Create free account
hub / github.com/coderwhy/coderhub / getCommentsByMomentId

Method getCommentsByMomentId

src/service/comment.service.js:30–41  ·  view source on GitHub ↗
(momentId)

Source from the content-addressed store, hash-verified

28 }
29
30 async getCommentsByMomentId(momentId) {
31 const statement = `
32 SELECT
33 m.id, m.content, m.comment_id commendId, m.createAt createTime,
34 JSON_OBJECT('id', u.id, 'name', u.name) user
35 FROM comment m
36 LEFT JOIN user u ON u.id = m.user_id
37 WHERE moment_id = ?;
38 `;
39 const [result] = await connection.execute(statement, [momentId]);
40 return result;
41 }
42}
43
44module.exports = new CommentService();

Callers 1

listMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected