Skip to content

Commit

Permalink
Merge pull request #86 from UlfBj/c-r-refactor
Browse files Browse the repository at this point in the history
range refactor cleanup
  • Loading branch information
UlfBj authored Jan 28, 2025
2 parents 308e42c + bd4f340 commit d5defa2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/vissv2server/vissv2server.go
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ func validateData(requestMap map[string]interface{}, searchData []utils.SearchDa
if requestMap["filter"] != nil {
for i := 0; i < len(filterList); i++ {
var paramMap map[string]interface{}
if filterList[i].Type == "range" { //parameter:[{"boundary-op":"a", "boundary": "x", "combination-op":"b"},{"boundary-op":"c", "boundary": "y"}]
if filterList[i].Type == "range" { //parameter:[{"logic-op":"a", "boundary": "x", "combination-op":"b"},{"logic-op":"c", "boundary": "y"}]
utils.MapRequest(filterList[i].Parameter, &paramMap)
bVal1, bVal2 := getRangeBoundaries(paramMap)
if !utils.IsNumber(bVal1) || (len(bVal2) != 0 && !utils.IsNumber(bVal2)) { // number ok, one or two boundaries
Expand Down
4 changes: 2 additions & 2 deletions utils/grcputils.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,10 +380,10 @@ func getPbRangeFilterValue(index int, valueMap interface{}) *pb.FilterExpression
switch vv := valueMap.(type) {
case []interface{}:
rangeObject := vv[index].(map[string]interface{})
protoRangeValue.LogicOperator = rangeObject["boundary-op"].(string)
protoRangeValue.LogicOperator = rangeObject["logic-op"].(string)
protoRangeValue.Boundary = rangeObject["boundary"].(string)
case map[string]interface{}:
protoRangeValue.LogicOperator = vv["boundary-op"].(string)
protoRangeValue.LogicOperator = vv["logic-op"].(string)
protoRangeValue.Boundary = vv["boundary"].(string)
default:
return nil
Expand Down

0 comments on commit d5defa2

Please sign in to comment.