fix: delete branch from user wrong body

This commit is contained in:
Methapon2001 2024-04-04 15:50:30 +07:00
parent d3e535374c
commit 79f844adee
2 changed files with 27 additions and 2 deletions

View file

@ -196,9 +196,9 @@ export class UserBranchController extends Controller {
}
@Delete()
async deleteUserBranch(@Path() userId: string, @Body() body: BranchUserBody) {
async deleteUserBranch(@Path() userId: string, @Body() body: UserBranchBody) {
await prisma.$transaction(
body.user.map((v) => prisma.branchUser.deleteMany({ where: { userId, branchId: v } })),
body.branch.map((v) => prisma.branchUser.deleteMany({ where: { userId, branchId: v } })),
);
}