Reject username

This commit is contained in:
Belen Curcio
2017-11-20 02:04:19 -03:00
parent 01b8c7aee6
commit 1756c7c050
5 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ export default {
}
}
}),
RejectUsername: ({variables: {input: {id: userId}}}) => ({
RejectUsername: ({variables: {id: userId}}) => ({
updateQueries: {
TalkAdmin_Community: (prev) => {
const updated = update(prev, {
@@ -59,7 +59,7 @@ class User extends React.Component {
{me.id !== user.id &&
<ActionsMenu icon="not_interested">
<ActionsMenuItem
disabled={!get(user, 'status.suspension.until')}
disabled={get(user, 'status.suspension.until')}
onClick={this.showSuspenUserDialog}>
Suspend User
</ActionsMenuItem>
@@ -45,7 +45,7 @@ class RejectUsernameDialog extends Component {
const next = () => this.setState({stage: stage + 1});
const suspend = async () => {
try {
await rejectUsername({id: user.id, message: this.state.email});
await rejectUsername(user.id);
this.props.handleClose();
} catch (err) {
+1 -1
View File
@@ -7,7 +7,7 @@ export default {
'SetUserSuspensionStatusResponse',
'SetCommentStatusResponse',
'SuspendUserResponse',
'RejectUsernameResponse',
'SetUsernameStatusResponse',
'CreateCommentResponse',
'CreateFlagResponse',
'EditCommentResponse',
+5 -5
View File
@@ -179,17 +179,17 @@ export const withSuspendUser = withMutation(
export const withRejectUsername = withMutation(
gql`
mutation RejectUsername($input: RejectUsernameInput!) {
rejectUsername(input: $input) {
...RejectUsernameResponse
mutation RejectUsername($id: ID!) {
rejectUsername(id: $id) {
...SetUsernameStatusResponse
}
}
`, {
props: ({mutate}) => ({
rejectUsername: (input) => {
rejectUsername: (id) => {
return mutate({
variables: {
input,
id,
},
});
}