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

2263
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -117,6 +117,9 @@ export class UserSchema extends PothosSchema {
adminNote: t.relation('adminNote', { adminNote: t.relation('adminNote', {
description: 'The admin note of the user.', 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 // ban user from clerk
await clerkClient.users.banUser(args.userId) 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' return 'Banned'
}, },
}), }),

File diff suppressed because one or more lines are too long