mirror of
https://github.com/wassname/talk.git
synced 2026-07-19 11:28:50 +08:00
Approve Username fix
This commit is contained in:
@@ -6,7 +6,7 @@ import {withFragments} from 'plugin-api/beta/client/hocs';
|
||||
import {Spinner} from 'coral-ui';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import {withUnBanUser} from 'coral-framework/graphql/mutations';
|
||||
import {withApproveUsername} from 'coral-framework/graphql/mutations';
|
||||
import {showBanUserDialog} from 'actions/banUserDialog';
|
||||
import {showSuspendUserDialog} from 'actions/suspendUserDialog';
|
||||
import {showRejectUsernameDialog} from '../../../actions/community';
|
||||
@@ -24,11 +24,8 @@ class FlaggedAccountsContainer extends Component {
|
||||
super(props);
|
||||
}
|
||||
|
||||
approveUser = ({userId}) => {
|
||||
return this.props.unBanUser({
|
||||
id: userId,
|
||||
status: false
|
||||
});
|
||||
approveUser = ({userId: id}) => {
|
||||
return this.props.approveUsername(id);
|
||||
}
|
||||
|
||||
loadMore = () => {
|
||||
@@ -83,7 +80,7 @@ FlaggedAccountsContainer.propTypes = {
|
||||
showSuspendUserDialog: PropTypes.func,
|
||||
showRejectUsernameDialog: PropTypes.func,
|
||||
viewUserDetail: PropTypes.func,
|
||||
unBanUser: PropTypes.func,
|
||||
approveUsername: PropTypes.func,
|
||||
data: PropTypes.object,
|
||||
root: PropTypes.object
|
||||
};
|
||||
@@ -121,7 +118,7 @@ const mapDispatchToProps = (dispatch) =>
|
||||
|
||||
export default compose(
|
||||
connect(null, mapDispatchToProps),
|
||||
withUnBanUser,
|
||||
withApproveUsername,
|
||||
withFragments({
|
||||
root: gql`
|
||||
fragment TalkAdminCommunity_FlaggedAccounts_root on RootQuery {
|
||||
|
||||
@@ -177,6 +177,25 @@ export const withSuspendUser = withMutation(
|
||||
})
|
||||
});
|
||||
|
||||
export const withApproveUsername = withMutation(
|
||||
gql`
|
||||
mutation ApproveUsername($id: ID!) {
|
||||
approveUsername(id: $id) {
|
||||
...SetUsernameStatusResponse
|
||||
}
|
||||
}
|
||||
`, {
|
||||
props: ({mutate}) => ({
|
||||
approveUsername: (id) => {
|
||||
return mutate({
|
||||
variables: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
export const withRejectUsername = withMutation(
|
||||
gql`
|
||||
mutation RejectUsername($id: ID!) {
|
||||
|
||||
Reference in New Issue
Block a user