Reverting

This commit is contained in:
gaba
2016-11-29 11:17:27 -08:00
parent 27eb341fa8
commit 281d4f6552
5 changed files with 23 additions and 31 deletions
+1 -9
View File
@@ -6,8 +6,7 @@ import {
FETCH_COMMENTERS_FAILURE,
SORT_UPDATE,
COMMENTERS_NEW_PAGE,
SET_ROLE,
SET_STATUS
SET_ROLE
} from '../constants/community';
import {base, getInit, handleResp} from '../../../coral-framework/helpers/response';
@@ -48,10 +47,3 @@ export const setRole = (id, role) => dispatch => {
return dispatch({type: SET_ROLE, id, role});
});
};
export const setStatus = (id, status) => dispatch => {
return fetch(`${base}/user/${id}/status`, getInit('POST', {status}))
.then(() => {
return dispatch({type: SET_STATUS, id, status});
});
};
+7 -7
View File
@@ -1,7 +1,7 @@
/**
* Action disptacher related to users
*/
export const updateUserStatus = (status, id) => (dispatch) => {
dispatch({type: 'USER_STATUS_UPDATE', id, status});
};
// /**
// * Action disptacher related to users
// */
//
// export const updateUserStatus = (status, id) => (dispatch) => {
// dispatch({type: 'USER_STATUS_UPDATE', id, status});
// };
+6 -6
View File
@@ -52,14 +52,14 @@ export default props => {
// Check if an action can be performed over a comment
const canShowAction = (action, comment) => {
const status = comment.get('status'); // accepted
const status = comment.get('status');
const flagged = comment.get('flagged');
const banned = comment.get('banned');
//const banned = comment.get('banned');
// If the user that authored the comment is banned then do not ban it again.
if (action === 'ban' && !banned) {
return false;
}
// // If the user that authored the comment is banned then do not ban it again.
// if (action === 'ban' && !banned) {
// return false;
// }
// If it is flagged do not flag it .
if (action === 'flag' && (status || flagged === true)) {
@@ -54,8 +54,8 @@ const Community = ({isFetching, commenters, ...props}) => {
</form>
</Cell>
<Cell col={8}>
{ isFetching && <Loading/> }
{ !hasResults && <NoResults/> }
{ isFetching && <Loading /> }
{ !hasResults && <NoResults /> }
{ hasResults &&
<Table
headers={tableHeaders}
@@ -52,13 +52,13 @@ class ModerationQueue extends React.Component {
// Dispatch the appropiate action
onAction (status, id) {
switch(status){
case 'banned':
this.props.dispatch(updateUserStatus(status, id));
break;
default:
this.props.dispatch(updateStatus(status, id));
}
// switch(status){
// case 'banned':
// this.props.dispatch(updateUserStatus(status, id));
// break;
// default:
this.props.dispatch(updateStatus(status, id));
//}
}
// Dispatch the update comment status action