diff --git a/models/comment.js b/models/comment.js index b2bd0367c..3f9ae1a65 100644 --- a/models/comment.js +++ b/models/comment.js @@ -201,7 +201,7 @@ CommentSchema.statics.findByActionType = (action_type) => Action * @return {Promise} */ CommentSchema.statics.findIdsByActionType = (action_type) => Action - .findCommentsIdByActionType(action_type, 'comment') + .findCommentsIdByActionType(action_type, 'comments') .then((actions) => actions.map(a => a.item_id)); /** diff --git a/tests/models/comment.js b/tests/models/comment.js index 363fd9222..91f51ccb8 100644 --- a/tests/models/comment.js +++ b/tests/models/comment.js @@ -73,12 +73,12 @@ describe('models.Comment', () => { const actions = [{ action_type: 'flag', item_id: '3', - item_type: 'comment', + item_type: 'comments', user_id: '123' }, { action_type: 'like', item_id: '1', - item_type: 'comment', + item_type: 'comments', user_id: '456' }]; diff --git a/tests/routes/api/comments/index.js b/tests/routes/api/comments/index.js index 59160a36f..360daa5dc 100644 --- a/tests/routes/api/comments/index.js +++ b/tests/routes/api/comments/index.js @@ -58,11 +58,11 @@ describe('/api/v1/comments', () => { const actions = [{ action_type: 'flag', item_id: 'abc', - item_type: 'comment' + item_type: 'comments' }, { action_type: 'like', item_id: 'hij', - item_type: 'comment' + item_type: 'comments' }]; beforeEach(() => {