fix user update role and department
This commit is contained in:
@@ -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, ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user