-
Notifications
You must be signed in to change notification settings - Fork 361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mod queue #26
Conversation
|
||
router.get('/action/:action_type', (req, res, next) => { | ||
Action.find({'action_type': req.params.action_type, 'item_type': 'comment'}).then((actions) => { | ||
Comment.find({'id': {'$in': actions.map(function(a){return a.item_id;})}}).exec(function(err, comments){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This endpoint should only return comments that have a flag and an empty status. Aka, have been flagged but do not yet have a moderation action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please refactor this database call into the model/comment.js file to keep all database access in a common place.
}); | ||
|
||
router.get('/status/rejected', (req, res, next) => { | ||
Comment.find({'status': 'rejected'}).then((comments) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please refactor to a function on the model.
}); | ||
|
||
router.get('/status/pending', (req, res, next) => { | ||
Comment.find({'status': ''}).then((comments) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please refactor to a function on the model.
//============================================================================== | ||
|
||
router.delete('/:comment_id', (req, res, next) => { | ||
Comment.remove(req.params.comment_id).then(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please refactor to a function on the model.
What does this PR do?
Adds endpoints for
How do I test this PR?
AND
@coralproject/tech