Updating user queue routes.

This commit is contained in:
David Jay
2017-02-03 10:18:29 -08:00
parent feb0860ba1
commit d92c2d9744
4 changed files with 4 additions and 11 deletions
+2 -2
View File
@@ -15,7 +15,7 @@ export const fetchModerationQueueComments = () => {
return Promise.all([
coralApi('/queue/comments/premod'),
coralApi('/queue/users/pending'),
coralApi('/queue/users/flagged'),
coralApi('/queue/comments/rejected'),
coralApi('/queue/comments/flagged')
])
@@ -46,7 +46,7 @@ export const fetchPendingUsersQueue = () => {
return dispatch => {
dispatch({type: commentTypes.COMMENTS_MODERATION_QUEUE_FETCH_REQUEST});
return coralApi('/queue/users/pending')
return coralApi('/queue/users/flagged')
.then(addUsersCommentsActions.bind(this, dispatch));
};
};
@@ -1,6 +1,4 @@
import React from 'react';
import Linkify from 'react-linkify';
import styles from './ModerationList.css';
import I18n from 'coral-framework/modules/i18n/i18n';
@@ -9,13 +7,10 @@ import translations from '../translations.json';
import {Icon} from 'react-mdl';
import ActionButton from './ActionButton';
const linkify = new Linkify();
// Render a single comment for the list
const User = props => {
const {action, user} = props;
let userStatus = user.status;
const links = user.settings.bio ? linkify.getMatches(user.settings.bio) : [];
// Do not display unless the user status is 'pending' or 'banned'.
// This means that they have already been reviewed and approved.
@@ -26,8 +21,6 @@ const User = props => {
<span>{user.displayName}</span>
</div>
<div className={styles.sideActions}>
{links ?
<span className={styles.hasLinks}><Icon name='error_outline'/> Contains Link</span> : null}
<div className={`actions ${styles.actions}`}>
{props.modActions.map(
(action, i) =>
+1 -1
View File
@@ -79,7 +79,7 @@ router.get('/comments/flagged', authorization.needed('ADMIN'), (req, res, next)
});
// Returns back all the users that are in the moderation queue.
router.get('/users/pending', (req, res, next) => {
router.get('/users/flagged', (req, res, next) => {
UsersService.moderationQueue()
.then((users) => {
return Promise.all([
+1 -1
View File
@@ -110,7 +110,7 @@ describe('/api/v1/queue', () => {
it('should return all pending users and actions', function(done){
chai.request(app)
.get('/api/v1/queue/users/pending')
.get('/api/v1/queue/users/flagged')
.set(passport.inject({roles: ['ADMIN']}))
.end(function(err, res){
expect(err).to.be.null;