Fixed encoding & URL issues for users & groups pages (#896)
* Fixed encoding & URL issues for users & groups pages * Update portal-ui/src/screens/Console/Users/ListUsers.tsx Co-authored-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
This commit is contained in:
@@ -60,7 +60,7 @@ type UpdateUserGroupsParams struct {
|
||||
Body *models.UpdateUserGroups
|
||||
/*
|
||||
Required: true
|
||||
In: path
|
||||
In: query
|
||||
*/
|
||||
Name string
|
||||
}
|
||||
@@ -74,6 +74,8 @@ func (o *UpdateUserGroupsParams) BindRequest(r *http.Request, route *middleware.
|
||||
|
||||
o.HTTPRequest = r
|
||||
|
||||
qs := runtime.Values(r.URL.Query())
|
||||
|
||||
if runtime.HasBody(r) {
|
||||
defer r.Body.Close()
|
||||
var body models.UpdateUserGroups
|
||||
@@ -102,8 +104,8 @@ func (o *UpdateUserGroupsParams) BindRequest(r *http.Request, route *middleware.
|
||||
res = append(res, errors.Required("body", "body", ""))
|
||||
}
|
||||
|
||||
rName, rhkName, _ := route.Params.GetOK("name")
|
||||
if err := o.bindName(rName, rhkName, route.Formats); err != nil {
|
||||
qName, qhkName, _ := qs.GetOK("name")
|
||||
if err := o.bindName(qName, qhkName, route.Formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
if len(res) > 0 {
|
||||
@@ -112,15 +114,22 @@ func (o *UpdateUserGroupsParams) BindRequest(r *http.Request, route *middleware.
|
||||
return nil
|
||||
}
|
||||
|
||||
// bindName binds and validates parameter Name from path.
|
||||
// bindName binds and validates parameter Name from query.
|
||||
func (o *UpdateUserGroupsParams) bindName(rawData []string, hasKey bool, formats strfmt.Registry) error {
|
||||
if !hasKey {
|
||||
return errors.Required("name", "query", rawData)
|
||||
}
|
||||
var raw string
|
||||
if len(rawData) > 0 {
|
||||
raw = rawData[len(rawData)-1]
|
||||
}
|
||||
|
||||
// Required: true
|
||||
// Parameter is provided by construction from the route
|
||||
// AllowEmptyValue: false
|
||||
|
||||
if err := validate.RequiredString("name", "query", raw); err != nil {
|
||||
return err
|
||||
}
|
||||
o.Name = raw
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user