filters
This commit is contained in:
@@ -46,7 +46,7 @@ func ParseWhereScopes[T any](c fiber.Ctx, ignoredKeys []string, formColumnMappin
|
||||
}
|
||||
|
||||
func extractOperator(key string) (base string, operatorSuffix string) {
|
||||
suffixes := []string{"_gt", "_gte", "_lt", "_lte", "_eq", "_neq"}
|
||||
suffixes := []string{"_gt", "_gte", "_lt", "_lte", "_eq", "_neq", "_in"}
|
||||
for _, suf := range suffixes {
|
||||
if strings.HasSuffix(key, suf) {
|
||||
return strings.TrimSuffix(key, suf), suf[1:]
|
||||
@@ -69,6 +69,8 @@ func resolveOperator(suffix string) string {
|
||||
return "!="
|
||||
case "eq":
|
||||
return "="
|
||||
case "in":
|
||||
return "IN"
|
||||
default:
|
||||
return "LIKE"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user