@@ -188,6 +188,18 @@ export class AdminUsersService {
|
||||
});
|
||||
}
|
||||
|
||||
async updateUser(id: bigint, dto: { nickname: string }) {
|
||||
const user = await this.prisma.user.findUnique({ where: { id }, select: { id: true } });
|
||||
if (!user) throw new NotFoundException('用户不存在');
|
||||
const nickname = dto.nickname.trim() || null;
|
||||
const updated = await this.prisma.user.update({
|
||||
where: { id },
|
||||
data: { nickname },
|
||||
select: { id: true, userNo: true, nickname: true },
|
||||
});
|
||||
return serializeBigInt(updated);
|
||||
}
|
||||
|
||||
async previewBatchDelete(ids: bigint[]) {
|
||||
const uniqueIds = [...new Set(ids)];
|
||||
if (!uniqueIds.length) {
|
||||
|
||||
Reference in New Issue
Block a user