proccessResults also for put/post
This commit is contained in:
11
hooks.go
11
hooks.go
@@ -83,3 +83,14 @@ func savedObject(c *Context, m mgocrud.ModelInterface, changes bson.M) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func processResults(c *Context, m mgocrud.ModelInterface, results interface{}) error {
|
||||
if i, ok := m.(interface {
|
||||
ProcessResults(*Context, interface{}) error
|
||||
}); ok {
|
||||
// custom select manipulation
|
||||
err := i.ProcessResults(c, results)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user