File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ type TransactionQueryFilter struct {
4040 DestinationAccountID string `form:"destination"`
4141 EnvelopeID string `form:"envelope"`
4242 Reconciled bool `form:"reconciled"`
43- AccountID string `form:"account" createField :"false"`
43+ AccountID string `form:"account" filterField :"false"`
4444}
4545
4646func (f TransactionQueryFilter ) ToCreate (c * gin.Context ) (models.TransactionCreate , bool ) {
Original file line number Diff line number Diff line change @@ -25,11 +25,13 @@ func GetURLFields(url *url.URL, filter any) []any {
2525 field := val .Type ().Field (i ).Name
2626 param := val .Type ().Field (i ).Tag .Get ("form" )
2727
28- // createField is a struct tag that allows to specify if the field is part
29- // of the fields to filter for on the original struct
30- createField := val .Type ().Field (i ).Tag .Get ("createField" )
28+ // filterField is a struct tag that allows to specify if the field
29+ // is used to filter resources directly (e.g. SourceAccountID on a TransactionQueryFilter)
30+ // or if it is a meta field that is processed by explicit logic outside of
31+ // GetURLFields (e.g. AccountID on a TransactionQueryFilter)
32+ filterField := val .Type ().Field (i ).Tag .Get ("filterField" )
3133
32- if url .Query ().Has (param ) && createField != "false" {
34+ if url .Query ().Has (param ) && filterField != "false" {
3335 queryFields = append (queryFields , field )
3436 }
3537 }
You can’t perform that action at this time.
0 commit comments