Skip to content

Commit

Permalink
Merge pull request #37 from CMU-17313Q/anonymous-post-backend
Browse files Browse the repository at this point in the history
Add backend logic for posting anonymously (User Story 4)
  • Loading branch information
mohamed-elzeni authored Sep 26, 2024
2 parents 7df6240 + 394d19b commit 3ebbe02
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 13 deletions.
23 changes: 18 additions & 5 deletions node_modules/nodebb-plugin-composer-default/static/lib/composer.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/categories/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ module.exports = function (Categories) {

cache.del('categories:cid');
await clearParentCategoryCache(parentCid);
console.log('Latifa : Refactored code executed');
const cloneFromCid = parseInt(data.cloneFromCid, 10);
if (cloneFromCid) {
category = await Categories.copySettingsFrom(cloneFromCid, category.cid, !data.parentCid);
Expand Down
1 change: 0 additions & 1 deletion src/controllers/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const relative_path = nconf.get('relative_path');
const url = nconf.get('url');

const handleSuccessfulResponse = (statusCode, res, payload) => {
console.log('Aisha');
if (res.req.loggedIn) {
res.set('cache-control', 'private');
}
Expand Down
3 changes: 3 additions & 0 deletions src/topics/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ module.exports = function (Topics) {
await user.isReadyToPost(uid, data.cid);
}

if (data.isAnonymous) {
data.uid = 0;
}
const tid = await Topics.create(data);

let postData = data;
Expand Down
1 change: 0 additions & 1 deletion src/user/uploads.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const _validatePath = async (relativePaths) => {
};

async function dissociateUploadsForPids(pids, idx, uploadNames) {
console.log('Ahmad');
return Promise.all(
pids.map(async pid => posts.uploads.dissociate(pid, uploadNames[idx]))
);
Expand Down

0 comments on commit 3ebbe02

Please sign in to comment.