fix update karyawan
This commit is contained in:
@@ -118,14 +118,14 @@ func (s *UserService) Update(ctx mycontext.Context, id int64, userReq *entity.Us
|
||||
}
|
||||
|
||||
//if changed branch
|
||||
if userReq.PartnerID != nil {
|
||||
branch, err := s.branchRepo.GetBranchByID(ctx, *userReq.PartnerID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// if userReq.PartnerID != nil {
|
||||
// branch, err := s.branchRepo.GetBranchByID(ctx, *userReq.PartnerID)
|
||||
// if err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
|
||||
existingUser.PartnerName = branch.Name
|
||||
}
|
||||
// existingUser.PartnerName = branch.Name
|
||||
// }
|
||||
|
||||
err = existingUser.ToUpdatedUser(*userReq)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user