chuc mung ban da duoc ban
This commit is contained in:
@@ -117,6 +117,9 @@ export class UserSchema extends PothosSchema {
|
||||
adminNote: t.relation('adminNote', {
|
||||
description: 'The admin note of the user.',
|
||||
}),
|
||||
banned: t.exposeBoolean('banned', {
|
||||
description: 'The banned status of the user.',
|
||||
}),
|
||||
}),
|
||||
})
|
||||
}
|
||||
@@ -540,6 +543,13 @@ export class UserSchema extends PothosSchema {
|
||||
}
|
||||
// ban user from clerk
|
||||
await clerkClient.users.banUser(args.userId)
|
||||
// invalidate cache
|
||||
await ctx.http.invalidateCache()
|
||||
// update user banned status
|
||||
await this.prisma.user.update({
|
||||
where: { id: args.userId },
|
||||
data: { banned: true },
|
||||
})
|
||||
return 'Banned'
|
||||
},
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user