udpate User

This commit is contained in:
aditya.siregar
2024-08-28 14:28:57 +07:00
parent 083e5537ec
commit c1cfd794fc
3 changed files with 21 additions and 29 deletions
+3 -9
View File
@@ -115,15 +115,9 @@ func (s *UserService) Update(ctx mycontext.Context, id int64, userReq *entity.Us
return nil, errors.New("user not found")
}
//if changed branch
// if userReq.PartnerID != nil {
// branch, err := s.branchRepo.GetBranchByID(ctx, *userReq.PartnerID)
// if err != nil {
// return nil, err
// }
// existingUser.PartnerName = branch.Name
// }
if *existingUser.PartnerID != *userReq.PartnerID {
return nil, errors.New("user not found")
}
err = existingUser.ToUpdatedUser(*userReq)
if err != nil {