Skip to content

Commit 0a18a56

Browse files
committed
Remove cache from filters, was duplicating incorrect data
1 parent c4db4a2 commit 0a18a56

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

backend/internal/tags/filters.go

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ import (
1616

1717
func GetFilterMap(m interface{}, globalTablePrefix string) map[string]model.FilterMapValue {
1818
name := getName(m)
19-
if val, exists := getCache(name); exists {
20-
return val
21-
}
22-
2319
filterMap := make(map[string]model.FilterMapValue)
2420

2521
// TypeOf returns the reflection Type that represents the dynamic type of variable.
@@ -60,12 +56,13 @@ func GetFilterMap(m interface{}, globalTablePrefix string) map[string]model.Filt
6056
// Get the field tag value
6157
filterTag := field.Tag.Get("filter")
6258
dbTag := field.Tag.Get("gorm")
63-
f := model.FilterMapValue{
64-
Model: name,
65-
}
6659

6760
// Filter -> Schema mapping
6861
if filterTag != "" && filterTag != "-" {
62+
f := model.FilterMapValue{
63+
Model: name,
64+
}
65+
6966
f.Schema = getFilterTagSchema(filterTag)
7067
parts := strings.Split(filterTag, ",")
7168

@@ -89,11 +86,11 @@ func GetFilterMap(m interface{}, globalTablePrefix string) map[string]model.Filt
8986
f.Field = fmt.Sprintf("%s%s", tablePrefix, database.QuoteTableName(matches[1]))
9087
}
9188
}
89+
9290
filterMap[parts[0]] = f
9391
}
9492
}
9593

96-
setCache(name, filterMap)
9794
return filterMap
9895
}
9996

0 commit comments

Comments
 (0)