proccessResults also for put/post

This commit is contained in:
Sebastian Frank
2019-11-30 14:08:42 +01:00
parent c2e158070f
commit 7f98182e94
2 changed files with 56 additions and 33 deletions

View File

@@ -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
}