mirror of
https://github.com/wassname/talk.git
synced 2026-08-08 11:28:12 +08:00
Reject username
This commit is contained in:
@@ -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) {
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ export default {
|
||||
'SetUserSuspensionStatusResponse',
|
||||
'SetCommentStatusResponse',
|
||||
'SuspendUserResponse',
|
||||
'RejectUsernameResponse',
|
||||
'SetUsernameStatusResponse',
|
||||
'CreateCommentResponse',
|
||||
'CreateFlagResponse',
|
||||
'EditCommentResponse',
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user