Drop Filter pointer
This commit is contained in:
@@ -28,7 +28,7 @@ func authBasic[T any](_ http.ResponseWriter, r *http.Request, api *API, name, pa
|
||||
api,
|
||||
name,
|
||||
&ListOpts{
|
||||
Filters: []*Filter{
|
||||
Filters: []Filter{
|
||||
{
|
||||
Path: pathUser,
|
||||
Op: "eq",
|
||||
|
||||
@@ -22,7 +22,7 @@ func authBearer[T any](_ http.ResponseWriter, r *http.Request, api *API, name, p
|
||||
api,
|
||||
name,
|
||||
&ListOpts{
|
||||
Filters: []*Filter{
|
||||
Filters: []Filter{
|
||||
{
|
||||
Path: pathToken,
|
||||
Op: "eq",
|
||||
|
||||
@@ -46,7 +46,7 @@ func Delete[TOut any](ctx context.Context, api *API, id string, opts *UpdateOpts
|
||||
|
||||
func FindName[TOut any](ctx context.Context, api *API, name, shortID string) (*TOut, error) {
|
||||
listOpts := &ListOpts{
|
||||
Filters: []*Filter{
|
||||
Filters: []Filter{
|
||||
{
|
||||
Path: "id",
|
||||
Op: "hp",
|
||||
|
||||
6
list.go
6
list.go
@@ -24,7 +24,7 @@ type ListOpts struct {
|
||||
Offset int64
|
||||
After string
|
||||
Sorts []string
|
||||
Filters []*Filter
|
||||
Filters []Filter
|
||||
|
||||
IfNoneMatch []httpheader.EntityTag
|
||||
|
||||
@@ -210,7 +210,7 @@ func (api *API) parseListOpts(r *http.Request) (*ListOpts, error) {
|
||||
}
|
||||
|
||||
for _, val := range vals {
|
||||
f := &Filter{
|
||||
f := Filter{
|
||||
Path: path,
|
||||
Op: "eq",
|
||||
Value: val,
|
||||
@@ -257,7 +257,7 @@ func (api *API) filterList(ctx context.Context, cfg *config, opts *ListOpts, lis
|
||||
return list, nil
|
||||
}
|
||||
|
||||
func match(obj any, filters []*Filter) (bool, error) {
|
||||
func match(obj any, filters []Filter) (bool, error) {
|
||||
for _, filter := range filters {
|
||||
var matches bool
|
||||
|
||||
|
||||
Reference in New Issue
Block a user