Files
talk/routes/api/queue/index.js
T
Wyatt Johnson b0f01cf00f Initial commit of asset queuing (#97)
* Initial commit of asset queuing

* Addresssing comments
2016-11-28 13:29:39 -05:00

27 lines
1.0 KiB
JavaScript

const express = require('express');
const Comment = require('../../../models/comment');
const Setting = require('../../../models/setting');
const router = express.Router();
//==============================================================================
// Get Routes
//==============================================================================
// Returns back all the comments that are in the moderation queue. The moderation queue is pre or post moderated,
// depending on the settings. The :moderation overwrites this settings.
// Pre-moderation: New comments are shown in the moderator queues immediately.
// Post-moderation: New comments do not appear in moderation queues unless they are flagged by other users.
router.get('/comments/pending', (req, res, next) => {
Setting.getModerationSetting().then(function({moderation}){
Comment.moderationQueue(moderation).then((comments) => {
res.status(200).json(comments);
});
})
.catch(error => {
next(error);
});
});
module.exports = router;