Skip to content

Commit

Permalink
changed the way is.Anonymous is set in Topics
Browse files Browse the repository at this point in the history
  • Loading branch information
Hakaabi committed Oct 16, 2024
1 parent b960e8a commit baf7a72
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/topics/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = function (Topics) {
lastposttime: 0,
postcount: 0,
viewcount: 0,
isAnonymous: data.isAnonymous,
isAnonymous: data.isAnonymous || 'false',
};

if (Array.isArray(data.tags) && data.tags.length) {
Expand Down
2 changes: 2 additions & 0 deletions test/topics.js
Original file line number Diff line number Diff line change
Expand Up @@ -2573,6 +2573,8 @@ describe('Anonymous Topic Creation', () => {
title: 'Default Topic Example',
content: 'This topic does not specify anonymity',
});

Check failure on line 2576 in test/topics.js

View workflow job for this annotation

GitHub Actions / test

Trailing spaces not allowed
console.log('Checking isAnonymous by default:', newTopic.topicData.isAnonymous);

assert(newTopic);
assert.strictEqual(newTopic.topicData.isAnonymous, 'false', 'Expected the topic to default to non-anonymous');
Expand Down

0 comments on commit baf7a72

Please sign in to comment.