Skip to content

Commit

Permalink
fix update user (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
haiziohhue authored Apr 4, 2024
1 parent 9827f76 commit 6830cbe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/user/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,13 @@ export class UserService {
.leftJoinAndSelect('user.dept', 'dept')
.where('user.id = :id', { id })
.getOne()

if(roleIds)
await manager
.createQueryBuilder()
.relation(UserEntity, 'roles')
.of(id)
.addAndRemove(roleIds, user.roles)

if(deptId)
await manager
.createQueryBuilder()
.relation(UserEntity, 'dept')
Expand Down

0 comments on commit 6830cbe

Please sign in to comment.