diff --git a/public/src/client/topic/events.js b/public/src/client/topic/events.js index 133b7cacc6..8894d62358 100644 --- a/public/src/client/topic/events.js +++ b/public/src/client/topic/events.js @@ -42,7 +42,7 @@ define('forum/topic/events', [ 'posts.verify': toggleVerifyMessage, 'posts.unverify': toggleVerifyMessage, - + 'posts.answer': toggleAnswered, 'posts.unanswer': toggleAnswered, diff --git a/src/controllers/write/posts.js b/src/controllers/write/posts.js index df19543c1e..fc58594ffc 100644 --- a/src/controllers/write/posts.js +++ b/src/controllers/write/posts.js @@ -162,6 +162,8 @@ Posts.verify = async (req, res) => { Posts.unverify = async (req, res) => { const data = await mock(req); await api.posts.unverify(req, data); + helpers.formatApiResponse(200, res); +}; Posts.answer = async (req, res) => { const data = await mock(req); diff --git a/src/posts/data.js b/src/posts/data.js index b2a5b8c0fc..1889c5d2d5 100644 --- a/src/posts/data.js +++ b/src/posts/data.js @@ -8,7 +8,7 @@ const intFields = [ 'uid', 'pid', 'tid', 'deleted', 'timestamp', 'upvotes', 'downvotes', 'deleterUid', 'edited', 'replies', 'bookmarks', 'verify', 'verifyUid', - 'answered', 'answererUid', + 'answered', 'answererUid', ]; module.exports = function (Posts) { diff --git a/test/posts.js b/test/posts.js index 122621f94c..063c341b96 100644 --- a/test/posts.js +++ b/test/posts.js @@ -280,13 +280,13 @@ describe('Post\'s', () => { assert.equal(hasBookmarked[0], false); }); }); - - describe('verifying', async () => { + + describe('verifying', async () => { it('should mark post verified', async () => { await apiPosts.verify({ uid: voterUid }, { pid: postData.pid, room_id: `topic_${postData.tid}` }); const isVerified = await posts.getPostField(postData.pid, 'verify'); - assert.strictEqual(isVerified, 1); - }); + assert.strictEqual(isVerified, 1); + }); }); describe('answering', async () => {