NOISSUE - Fix httputil implementation in users service (#1434)
Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
This commit is contained in:
parent
af0162f0df
commit
bb072b8ad2
|
@ -132,17 +132,14 @@ func decodeViewProfile(_ context.Context, r *http.Request) (interface{}, error)
|
||||||
|
|
||||||
func decodeListUsers(_ context.Context, r *http.Request) (interface{}, error) {
|
func decodeListUsers(_ context.Context, r *http.Request) (interface{}, error) {
|
||||||
o, err := httputil.ReadUintQuery(r, offsetKey, defOffset)
|
o, err := httputil.ReadUintQuery(r, offsetKey, defOffset)
|
||||||
if err != nil && err != errors.ErrNotFoundParam {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
l, err := httputil.ReadUintQuery(r, limitKey, defLimit)
|
l, err := httputil.ReadUintQuery(r, limitKey, defLimit)
|
||||||
if err != nil && err != errors.ErrNotFoundParam {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if err == errors.ErrNotFoundParam {
|
|
||||||
l = defLimit
|
|
||||||
}
|
|
||||||
|
|
||||||
e, err := httputil.ReadStringQuery(r, emailKey, "")
|
e, err := httputil.ReadStringQuery(r, emailKey, "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -232,17 +229,14 @@ func decodePasswordChange(_ context.Context, r *http.Request) (interface{}, erro
|
||||||
|
|
||||||
func decodeListMembersRequest(_ context.Context, r *http.Request) (interface{}, error) {
|
func decodeListMembersRequest(_ context.Context, r *http.Request) (interface{}, error) {
|
||||||
o, err := httputil.ReadUintQuery(r, offsetKey, defOffset)
|
o, err := httputil.ReadUintQuery(r, offsetKey, defOffset)
|
||||||
if err != nil && err != errors.ErrNotFoundParam {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
l, err := httputil.ReadUintQuery(r, limitKey, defLimit)
|
l, err := httputil.ReadUintQuery(r, limitKey, defLimit)
|
||||||
if err != nil && err != errors.ErrNotFoundParam {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if err == errors.ErrNotFoundParam {
|
|
||||||
l = defLimit
|
|
||||||
}
|
|
||||||
|
|
||||||
m, err := httputil.ReadMetadataQuery(r, metadataKey, nil)
|
m, err := httputil.ReadMetadataQuery(r, metadataKey, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue