udpate User
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user