fix user update role and department

This commit is contained in:
efrilm
2025-10-03 13:40:49 +07:00
parent 89d6d8df5e
commit d8942fa918
5 changed files with 51 additions and 9 deletions
+8 -8
View File
@@ -62,14 +62,14 @@ func (v *UserValidatorImpl) ValidateUpdateUserRequest(req *contract.UpdateUserRe
}
}
if req.Role != nil {
if strings.TrimSpace(*req.Role) == "" {
return errors.New("role cannot be empty"), constants.MalformedFieldErrorCode
}
if !isValidUserRole(*req.Role) {
return errors.New("invalid user role"), constants.MalformedFieldErrorCode
}
}
// if req.Role != nil {
// if strings.TrimSpace(*req.Role) == "" {
// return errors.New("role cannot be empty"), constants.MalformedFieldErrorCode
// }
// // if !isValidUserRole(*req.Role) {
// // return errors.New("invalid user role"), constants.MalformedFieldErrorCode
// // }
// }
return nil, ""
}