chuc mung ban da duoc ban

This commit is contained in:
2024-11-25 16:45:51 +07:00
parent 8abf867fbb
commit d1ba07434a
4 changed files with 1355 additions and 922 deletions

View File

@@ -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'
},
}),