refactored view package
This commit is contained in:
@@ -26,6 +26,18 @@ type Filter struct {
|
||||
Value any
|
||||
}
|
||||
|
||||
type ListFilter struct {
|
||||
filters []Filter
|
||||
}
|
||||
|
||||
func NewListFilter() *ListFilter {
|
||||
return &ListFilter{[]Filter{}}
|
||||
}
|
||||
|
||||
func (f *ListFilter) Add(field string, value any) {
|
||||
f.filters = append(f.filters, Filter{field, value})
|
||||
}
|
||||
|
||||
func GetList[T any](tx bun.Tx, pageOpts, defaults *PageOpts) *listgetter[T] {
|
||||
l := &listgetter[T]{
|
||||
items: new([]*T),
|
||||
|
||||
Reference in New Issue
Block a user