diff --git a/pkg/response/actions/gorm/control.go b/pkg/response/actions/gorm/control.go index c0e32fe..14b5fcd 100644 --- a/pkg/response/actions/gorm/control.go +++ b/pkg/response/actions/gorm/control.go @@ -61,7 +61,7 @@ func (e *Control) Handler() gin.HandlersChain { if e.opts.controlHandlers != nil { chain = append(e.opts.controlHandlers, chain...) } - if e.opts.Handlers != nil { + if e.opts.handlers != nil { chain = append(e.opts.handlers, chain...) } return chain diff --git a/pkg/response/actions/gorm/delete.go b/pkg/response/actions/gorm/delete.go index 90e0402..8242d4b 100644 --- a/pkg/response/actions/gorm/delete.go +++ b/pkg/response/actions/gorm/delete.go @@ -56,7 +56,7 @@ func (e *Delete) Handler() gin.HandlersChain { if e.opts.deleteHandlers != nil { chain = append(e.opts.deleteHandlers, chain...) } - if e.opts.Handlers != nil { + if e.opts.handlers != nil { chain = append(e.opts.handlers, chain...) } return chain diff --git a/pkg/response/actions/gorm/get.go b/pkg/response/actions/gorm/get.go index 68bf300..efbf21d 100644 --- a/pkg/response/actions/gorm/get.go +++ b/pkg/response/actions/gorm/get.go @@ -53,7 +53,7 @@ func (e *Get) Handler() gin.HandlersChain { if e.opts.getHandlers != nil { chain = append(e.opts.getHandlers, chain...) } - if e.opts.Handlers != nil { + if e.opts.handlers != nil { chain = append(e.opts.handlers, chain...) } return chain diff --git a/pkg/response/actions/gorm/options.go b/pkg/response/actions/gorm/options.go index 0e358a9..1ab8a42 100644 --- a/pkg/response/actions/gorm/options.go +++ b/pkg/response/actions/gorm/options.go @@ -26,7 +26,6 @@ type Option func(*Options) type Options struct { Model schema.Tabler Scope func(ctx *gin.Context, table schema.Tabler) func(db *gorm.DB) *gorm.DB - Handlers gin.HandlersChain TreeField string Depth int Key string @@ -62,7 +61,7 @@ func WithScope(scope func(ctx *gin.Context, table schema.Tabler) func(db *gorm.D func WithHandlers(handlers gin.HandlersChain) Option { return func(o *Options) { - o.Handlers = handlers + o.handlers = handlers } } diff --git a/pkg/response/actions/gorm/search.go b/pkg/response/actions/gorm/search.go index 4b445a7..1f64f17 100644 --- a/pkg/response/actions/gorm/search.go +++ b/pkg/response/actions/gorm/search.go @@ -56,7 +56,7 @@ func (e *Search) Handler() gin.HandlersChain { if e.opts.searchHandlers != nil { chain = append(e.opts.searchHandlers, chain...) } - if e.opts.Handlers != nil { + if e.opts.handlers != nil { chain = append(e.opts.handlers, chain...) } return chain