fix
This commit is contained in:
@@ -2,7 +2,6 @@ import { Request, Response } from 'express';
|
|||||||
import { prisma } from '../config/database';
|
import { prisma } from '../config/database';
|
||||||
import { AuthRequest } from '../middleware/auth';
|
import { AuthRequest } from '../middleware/auth';
|
||||||
import bcrypt from 'bcryptjs';
|
import bcrypt from 'bcryptjs';
|
||||||
import type { PrismaClient } from '@prisma/client';
|
|
||||||
|
|
||||||
export const userController = {
|
export const userController = {
|
||||||
// 获取所有用户 (管理员)
|
// 获取所有用户 (管理员)
|
||||||
@@ -230,7 +229,7 @@ export const userController = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 使用事务来确保数据一致性
|
// 使用事务来确保数据一致性
|
||||||
await prisma.$transaction(async (tx: PrismaClient) => {
|
await prisma.$transaction(async (tx) => {
|
||||||
// 删除用户现有的所有账号分配
|
// 删除用户现有的所有账号分配
|
||||||
await tx.accountAssignment.deleteMany({
|
await tx.accountAssignment.deleteMany({
|
||||||
where: { userId: id }
|
where: { userId: id }
|
||||||
|
|||||||
Reference in New Issue
Block a user