Merge branch 'akp/principal-list' of _OKE5H2PQKOUfzFFDuD4FA/default/CODE/gitness (#266)

This commit is contained in:
Akhilesh Pandey 2023-08-02 14:14:35 +00:00 committed by Harness
commit a35b5799a6

View File

@ -61,7 +61,7 @@ func ParseUserFilter(r *http.Request) *types.UserFilter {
// ParsePrincipalTypes extracts the principal types from the url. // ParsePrincipalTypes extracts the principal types from the url.
func ParsePrincipalTypes(r *http.Request) []enum.PrincipalType { func ParsePrincipalTypes(r *http.Request) []enum.PrincipalType {
pTypesRaw := r.Form[QueryParamType] pTypesRaw := r.URL.Query()[QueryParamType]
m := make(map[enum.PrincipalType]struct{}) // use map to eliminate duplicates m := make(map[enum.PrincipalType]struct{}) // use map to eliminate duplicates
for _, pTypeRaw := range pTypesRaw { for _, pTypeRaw := range pTypesRaw {
if pType, ok := enum.PrincipalType(pTypeRaw).Sanitize(); ok { if pType, ok := enum.PrincipalType(pTypeRaw).Sanitize(); ok {