Skip to content

Commit fe60183

Browse files
intojhanuragAllForNothing
authored andcommitted
legacy switch from decodeFilters
Signed-off-by: Anurag Ojha <aojharaj2004@gmail.com>
1 parent 575aed0 commit fe60183

1 file changed

Lines changed: 0 additions & 19 deletions

File tree

src/pkg/p2p/preheat/models/policy/policy.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ package policy
1616

1717
import (
1818
"encoding/json"
19-
"strconv"
2019
"time"
2120

2221
beego_orm "github.com/beego/beego/v2/client/orm"
@@ -198,24 +197,6 @@ func decodeFilters(filterStr string) ([]*Filter, error) {
198197
if err := json.Unmarshal([]byte(filterStr), &filters); err != nil {
199198
return nil, err
200199
}
201-
202-
// Convert value type
203-
// TODO: remove switch after UI bug #12579 fixed
204-
for _, f := range filters {
205-
if f.Type == FilterTypeVulnerability {
206-
switch f.Value.(type) {
207-
case string:
208-
sev, err := strconv.ParseInt(f.Value.(string), 10, 32)
209-
if err != nil {
210-
return nil, errors.Wrapf(err, "parse filters")
211-
}
212-
f.Value = (int)(sev)
213-
case float64:
214-
f.Value = (int)(f.Value.(float64))
215-
}
216-
}
217-
}
218-
219200
return filters, nil
220201
}
221202

0 commit comments

Comments
 (0)