Skip to content

Commit

Permalink
Merge pull request #34 from ssaigh/implement-backend-logic-anonymize-…
Browse files Browse the repository at this point in the history
…post

Task 2: Backend Logic to Anonymize Posts
  • Loading branch information
jdufitum authored Sep 26, 2024
2 parents 756c61e + 8491996 commit 10b9daf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/posts/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module.exports = function (Posts) {
const content = data.content.toString();
const timestamp = data.timestamp || Date.now();
const isMain = data.isMain || false;
const { annonymousType } = data;

if (!uid && parseInt(uid, 10) !== 0) {
throw new Error('[[error:invalid-uid]]');
Expand All @@ -35,6 +36,7 @@ module.exports = function (Posts) {
tid: tid,
content: content,
timestamp: timestamp,
annonymousType: annonymousType,
};

if (data.toPid) {
Expand Down

0 comments on commit 10b9daf

Please sign in to comment.