Fix account suspension

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2020-08-18 17:21:58 +02:00
parent f8ad3cd8fc
commit 2ea6286d3f
3 changed files with 29 additions and 21 deletions

View File

@@ -80,6 +80,14 @@ export const DELETE_ACCOUNT = gql`
}
`;
export const SUSPEND_USER = gql`
mutation SuspendUser($userId: ID) {
deleteAccount(userId: $userId) {
id
}
}
`;
export const CURRENT_USER_CLIENT = gql`
query {
currentUser @client {

View File

@@ -59,7 +59,7 @@
</template>
<script lang="ts">
import { Component, Vue, Prop } from "vue-property-decorator";
import { GET_USER, DELETE_ACCOUNT } from "../../graphql/user";
import { GET_USER, SUSPEND_USER } from "../../graphql/user";
import { usernameWithDomain } from "../../types/actor/actor.model";
import RouteName from "../../router/name";
import { IUser, ICurrentUserRole } from "../../types/current-user.model";
@@ -148,7 +148,7 @@ export default class AdminUserProfile extends Vue {
async deleteAccount() {
await this.$apollo.mutate<{ suspendProfile: { id: string } }>({
mutation: DELETE_ACCOUNT,
mutation: SUSPEND_USER,
variables: {
userId: this.id,
},