Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Send isBlacklisted to frontend #180

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions server/services/comments/comments.hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ module.exports = {
data: {
content: 'Comments of this blacklisted user are not visible.',
contentExcerpt: 'Comments of this blacklisted user are not visible.',
isBlacklisted: true,
hasMore: false
}
})
Expand All @@ -134,6 +135,7 @@ module.exports = {
data: {
content: 'Comments of this blacklisted user are not visible.',
contentExcerpt: 'Comments of this blacklisted user are not visible.',
isBlacklisted: true,
hasMore: false
}
})
Expand Down
6 changes: 6 additions & 0 deletions test/services/comments.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ describe('\'comments\' service', () => {
assert.equal(comment.contentExcerpt, 'Comments of this blacklisted user are not visible.');
});

it('sends isBlacklisted: true', async () => {
const comments = await service.find(params);
const comment = comments.data[1];
assert.equal(comment.isBlacklisted, true);
});

context('but if user is not authenticated', () => {
it('is visible', async () => {
const comments = await service.find();
Expand Down