fix: update branch status when assign user to branch
This commit is contained in:
parent
ebba5cff03
commit
3aa405db7b
1 changed files with 7 additions and 0 deletions
|
|
@ -560,6 +560,13 @@ export class UserController extends Controller {
|
|||
branchId: v,
|
||||
})),
|
||||
}),
|
||||
prisma.branch.updateMany({
|
||||
where: {
|
||||
id: { in: Array.isArray(branchId) ? branchId : [branchId] },
|
||||
status: "CREATED",
|
||||
},
|
||||
data: { status: "ACTIVE" },
|
||||
}),
|
||||
]);
|
||||
|
||||
if (branch[0]?.id !== user.branch[0]?.id) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue