mirror of
https://github.com/wassname/talk.git
synced 2026-07-28 11:27:05 +08:00
Suspend User Mutation
This commit is contained in:
@@ -18,7 +18,7 @@ class SuspendUserDialogContainer extends Component {
|
||||
const {userId, username, commentStatus, commentId, hideSuspendUserDialog, setCommentStatus, suspendUser, notify} = this.props;
|
||||
hideSuspendUserDialog();
|
||||
try {
|
||||
await suspendUser({id: userId, message, until});
|
||||
await suspendUser({id: userId, until});
|
||||
notify(
|
||||
'success',
|
||||
t('suspenduser.notify_suspend_until', username, timeago(until)),
|
||||
|
||||
@@ -3,6 +3,7 @@ import {createDefaultResponseFragments} from '../utils';
|
||||
// fragments defined here are automatically registered.
|
||||
export default {
|
||||
...createDefaultResponseFragments(
|
||||
'SetUserSuspensionStatusResponse',
|
||||
'SetCommentStatusResponse',
|
||||
'SuspendUserResponse',
|
||||
'RejectUsernameResponse',
|
||||
|
||||
@@ -160,9 +160,9 @@ export const withSetCommentStatus = withMutation(
|
||||
|
||||
export const withSuspendUser = withMutation(
|
||||
gql`
|
||||
mutation SuspendUser($input: SuspendUserInput!) {
|
||||
suspendUser(input: $input) {
|
||||
...SuspendUserResponse
|
||||
mutation SuspendUser($input: SetUserSuspensionStatusInput!) {
|
||||
setUserSuspensionStatus(input: $input) {
|
||||
...SetUserSuspensionStatusResponse
|
||||
}
|
||||
}
|
||||
`, {
|
||||
|
||||
@@ -19,7 +19,15 @@ module.exports = {
|
||||
const adminPage = client.page.admin();
|
||||
const {testData: {admin}} = client.globals;
|
||||
|
||||
adminPage.navigateAndLogin(admin);
|
||||
adminPage
|
||||
.navigate()
|
||||
.waitForElementVisible('@loginLayout')
|
||||
.waitForElementVisible('@signInForm')
|
||||
.setValue('@emailInput', admin.email)
|
||||
.setValue('@passwordInput', admin.password)
|
||||
.waitForElementVisible('@signInButton')
|
||||
.click('@signInButton')
|
||||
.waitForElementVisible('@moderationContainer');
|
||||
},
|
||||
'admin flags user\'s username as offensive': (client) => {
|
||||
const embedStream = client.page.embedStream();
|
||||
|
||||
Reference in New Issue
Block a user