Merge branch 'master' into 1588-frontend-show-link-information

This commit is contained in:
Alexander Friedland 2022-03-21 14:37:04 +01:00 committed by GitHub
commit 1baf855265
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 16 additions and 10 deletions

View File

@ -1,7 +1,7 @@
import gql from 'graphql-tag'
export const confirmPendingCreation = gql`
mutation ($id: Float!) {
mutation ($id: Int!) {
confirmPendingCreation(id: $id)
}
`

View File

@ -1,7 +1,7 @@
import gql from 'graphql-tag'
export const deletePendingCreation = gql`
mutation ($id: Float!) {
mutation ($id: Int!) {
deletePendingCreation(id: $id)
}
`

View File

@ -1,7 +1,7 @@
import gql from 'graphql-tag'
export const deleteUser = gql`
mutation ($userId: Float!) {
mutation ($userId: Int!) {
deleteUser(userId: $userId)
}
`

View File

@ -1,7 +1,7 @@
import gql from 'graphql-tag'
export const unDeleteUser = gql`
mutation ($userId: Float!) {
mutation ($userId: Int!) {
unDeleteUser(userId: $userId)
}
`

View File

@ -99,7 +99,7 @@ export default {
},
updateDeletedAt(userId, deletedAt) {
this.searchResult.find((obj) => obj.userId === userId).deletedAt = deletedAt
this.toastSuccess(this.$t('user_deleted'))
this.toastSuccess(deletedAt ? this.$t('user_deleted') : this.$t('user_recovered'))
},
},
watch: {

View File

@ -127,7 +127,10 @@ export class AdminResolver {
@Authorized([RIGHTS.DELETE_USER])
@Mutation(() => Date, { nullable: true })
async deleteUser(@Arg('userId') userId: number, @Ctx() context: any): Promise<Date | null> {
async deleteUser(
@Arg('userId', () => Int) userId: number,
@Ctx() context: any,
): Promise<Date | null> {
const user = await dbUser.findOne({ id: userId })
// user exists ?
if (!user) {
@ -146,7 +149,7 @@ export class AdminResolver {
@Authorized([RIGHTS.UNDELETE_USER])
@Mutation(() => Date, { nullable: true })
async unDeleteUser(@Arg('userId') userId: number): Promise<Date | null> {
async unDeleteUser(@Arg('userId', () => Int) userId: number): Promise<Date | null> {
const user = await dbUser.findOne({ id: userId }, { withDeleted: true })
// user exists ?
if (!user) {
@ -288,7 +291,7 @@ export class AdminResolver {
@Authorized([RIGHTS.DELETE_PENDING_CREATION])
@Mutation(() => Boolean)
async deletePendingCreation(@Arg('id') id: number): Promise<boolean> {
async deletePendingCreation(@Arg('id', () => Int) id: number): Promise<boolean> {
const entity = await AdminPendingCreation.findOneOrFail(id)
const res = await AdminPendingCreation.delete(entity)
return !!res
@ -296,7 +299,10 @@ export class AdminResolver {
@Authorized([RIGHTS.CONFIRM_PENDING_CREATION])
@Mutation(() => Boolean)
async confirmPendingCreation(@Arg('id') id: number, @Ctx() context: any): Promise<boolean> {
async confirmPendingCreation(
@Arg('id', () => Int) id: number,
@Ctx() context: any,
): Promise<boolean> {
const pendingCreation = await AdminPendingCreation.findOneOrFail(id)
const moderatorUser = context.user
if (moderatorUser.id === pendingCreation.userId)

View File

@ -94,7 +94,7 @@ export const createPendingCreation = gql`
`
export const confirmPendingCreation = gql`
mutation ($id: Float!) {
mutation ($id: Int!) {
confirmPendingCreation(id: $id)
}
`