mirror of
https://github.com/wassname/talk.git
synced 2026-08-16 11:29:31 +08:00
Reverting
This commit is contained in:
@@ -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});
|
||||
});
|
||||
};
|
||||
|
||||
@@ -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});
|
||||
// };
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user