( r *http.Request, conn *storage.Connection, user *models.User, )
| 13 | ) |
| 14 | |
| 15 | func (a *API) triggerAfterUserCreated( |
| 16 | r *http.Request, |
| 17 | conn *storage.Connection, |
| 18 | user *models.User, |
| 19 | ) error { |
| 20 | if !a.hooksMgr.Enabled(v0hooks.AfterUserCreated) { |
| 21 | return nil |
| 22 | } |
| 23 | |
| 24 | // We still check tx because we want to make sure we aren't calling this |
| 25 | // trigger in code paths that haven't actually created the user yet. |
| 26 | if err := checkTX(conn); err != nil { |
| 27 | return err |
| 28 | } |
| 29 | |
| 30 | req := v0hooks.NewAfterUserCreatedInput(r, user) |
| 31 | res := new(v0hooks.AfterUserCreatedOutput) |
| 32 | return a.hooksMgr.InvokeHook(conn, r, req, res) |
| 33 | } |
| 34 | |
| 35 | func (a *API) triggerBeforeUserCreated( |
| 36 | r *http.Request, |
no test coverage detected