support both scope and scopes parameter in decisions filter (#2882)

This commit is contained in:
blotus 2024-03-11 10:54:40 +01:00 committed by GitHub
parent e8ff13bc17
commit 6daaab1789
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -49,7 +49,7 @@ func BuildDecisionRequestWithFilter(query *ent.DecisionQuery, filter map[string]
if err != nil {
return nil, errors.Wrapf(InvalidFilter, "invalid contains value : %s", err)
}
case "scopes":
case "scopes", "scope": //Swagger mentions both of them, let's just support both to make sure we don't break anything
scopes := strings.Split(value[0], ",")
for i, scope := range scopes {
switch strings.ToLower(scope) {