mirror of
https://github.com/wassname/talk.git
synced 2026-07-01 08:20:25 +08:00
Refactor for setUserStatus to setUserBanStatus
This commit is contained in:
@@ -3,6 +3,7 @@ import {createDefaultResponseFragments} from '../utils';
|
||||
// fragments defined here are automatically registered.
|
||||
export default {
|
||||
...createDefaultResponseFragments(
|
||||
'SetUserBanStatusResponse',
|
||||
'SetUserSuspensionStatusResponse',
|
||||
'SetCommentStatusResponse',
|
||||
'SuspendUserResponse',
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user