diff --git a/client/coral-admin/src/routes/Community/components/Table.js b/client/coral-admin/src/routes/Community/components/Table.js
index 413859c40..bcf7cb10c 100644
--- a/client/coral-admin/src/routes/Community/components/Table.js
+++ b/client/coral-admin/src/routes/Community/components/Table.js
@@ -59,7 +59,7 @@ const Table = ({users, setRole, onHeaderClickHandler, setUserBanStatus, viewUser
containerClassName="talk-admin-community-people-dd-status"
value={getStatus(row.status)}
placeholder={t('community.status')}
- onChange={(status) => setUserBanStatus({id: row.id, status: status !== 'BANNED'})}>
+ onChange={(status) => setUserBanStatus({id: row.id, status: status === 'BANNED'})}>
diff --git a/client/coral-admin/src/routes/Community/containers/Community.js b/client/coral-admin/src/routes/Community/containers/Community.js
index d2aa673a5..633116569 100644
--- a/client/coral-admin/src/routes/Community/containers/Community.js
+++ b/client/coral-admin/src/routes/Community/containers/Community.js
@@ -3,7 +3,7 @@ import {bindActionCreators} from 'redux';
import {compose, gql} from 'react-apollo';
import withQuery from 'coral-framework/hocs/withQuery';
import {getDefinitionName} from 'coral-framework/utils';
-import {withSetUserBanStatus, withRejectUsername} from 'coral-framework/graphql/mutations';
+import {withRejectUsername} from 'coral-framework/graphql/mutations';
import FlaggedAccounts from '../containers/FlaggedAccounts';
import FlaggedUser from '../containers/FlaggedUser';
import {hideRejectUsernameDialog} from '../../../actions/community';
@@ -48,7 +48,6 @@ const withData = withQuery(gql`
export default compose(
connect(mapStateToProps, mapDispatchToProps),
- withSetUserBanStatus,
withRejectUsername,
withData
)(Community);
diff --git a/client/coral-admin/src/routes/Community/containers/People.js b/client/coral-admin/src/routes/Community/containers/People.js
index e618498ab..1e701e431 100644
--- a/client/coral-admin/src/routes/Community/containers/People.js
+++ b/client/coral-admin/src/routes/Community/containers/People.js
@@ -1,8 +1,10 @@
import React from 'react';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
+import {compose} from 'react-apollo';
import People from '../components/People';
import PropTypes from 'prop-types';
+import {withSetUserBanStatus} from 'coral-framework/graphql/mutations';
import {viewUserDetail} from '../../../actions/userDetail';
@@ -99,4 +101,7 @@ const mapDispatchToProps = (dispatch) =>
setSearchValue,
}, dispatch);
-export default connect(null, mapDispatchToProps)(PeopleContainer);
+export default compose(
+ connect(null, mapDispatchToProps),
+ withSetUserBanStatus,
+)(PeopleContainer);
diff --git a/client/coral-framework/graphql/fragments.js b/client/coral-framework/graphql/fragments.js
index 67df0e003..55b35a879 100644
--- a/client/coral-framework/graphql/fragments.js
+++ b/client/coral-framework/graphql/fragments.js
@@ -3,6 +3,7 @@ import {createDefaultResponseFragments} from '../utils';
// fragments defined here are automatically registered.
export default {
...createDefaultResponseFragments(
+ 'SetUserBanStatusResponse',
'SetUserSuspensionStatusResponse',
'SetCommentStatusResponse',
'SuspendUserResponse',
diff --git a/client/coral-framework/graphql/mutations.js b/client/coral-framework/graphql/mutations.js
index 5af205934..9987656aa 100644
--- a/client/coral-framework/graphql/mutations.js
+++ b/client/coral-framework/graphql/mutations.js
@@ -196,20 +196,19 @@ export const withRejectUsername = withMutation(
})
});
-export const withsetUserBanStatus = withMutation(
+export const withSetUserBanStatus = withMutation(
gql`
- mutation SetUserBanStatus($id: ID!, $status: Boolean!) {
- setUserBanStatus(id: $id, status: $status) {
+ mutation SetUserBanStatus($input: SetUserBanStatusInput!) {
+ setUserBanStatus(input: $input) {
...SetUserBanStatusResponse
}
}
`, {
props: ({mutate}) => ({
- setUserBanStatus: ({id, status}) => {
+ setUserBanStatus: (input) => {
return mutate({
variables: {
- id,
- status,
+ input,
},
});
}
@@ -228,7 +227,7 @@ export const withPostComment = withMutation(
postComment: (input) => {
return mutate({
variables: {
- input
+ input,
},
});
}