fix(filters): lint
This commit is contained in:
parent
87c027aafd
commit
bc6d812eb0
@ -17,8 +17,9 @@
|
|||||||
package migration
|
package migration
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"src.techknowlogick.com/xormigrate"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"src.techknowlogick.com/xormigrate"
|
||||||
"xorm.io/xorm"
|
"xorm.io/xorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -18,12 +18,13 @@ package models
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/ganigeorgiev/fexpr"
|
|
||||||
"reflect"
|
"reflect"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/ganigeorgiev/fexpr"
|
||||||
|
|
||||||
"code.vikunja.io/api/pkg/config"
|
"code.vikunja.io/api/pkg/config"
|
||||||
|
|
||||||
"github.com/iancoleman/strcase"
|
"github.com/iancoleman/strcase"
|
||||||
@ -191,29 +192,6 @@ func validateTaskFieldComparator(comparator taskFilterComparator) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func getFilterComparatorFromString(comparator string) (taskFilterComparator, error) {
|
|
||||||
switch comparator {
|
|
||||||
case "equals":
|
|
||||||
return taskFilterComparatorEquals, nil
|
|
||||||
case "greater":
|
|
||||||
return taskFilterComparatorGreater, nil
|
|
||||||
case "greater_equals":
|
|
||||||
return taskFilterComparatorGreateEquals, nil
|
|
||||||
case "less":
|
|
||||||
return taskFilterComparatorLess, nil
|
|
||||||
case "less_equals":
|
|
||||||
return taskFilterComparatorLessEquals, nil
|
|
||||||
case "not_equals":
|
|
||||||
return taskFilterComparatorNotEquals, nil
|
|
||||||
case "like":
|
|
||||||
return taskFilterComparatorLike, nil
|
|
||||||
case "in":
|
|
||||||
return taskFilterComparatorIn, nil
|
|
||||||
default:
|
|
||||||
return taskFilterComparatorInvalid, ErrInvalidTaskFilterComparator{Comparator: taskFilterComparator(comparator)}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func getFilterComparatorFromOp(op fexpr.SignOp) (taskFilterComparator, error) {
|
func getFilterComparatorFromOp(op fexpr.SignOp) (taskFilterComparator, error) {
|
||||||
switch op {
|
switch op {
|
||||||
case fexpr.SignEq:
|
case fexpr.SignEq:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user