fix: delete branch from user wrong body
This commit is contained in:
parent
d3e535374c
commit
79f844adee
2 changed files with 27 additions and 2 deletions
|
|
@ -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 } })),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue