Improve listeners and handlers (#350)

* improve listeners and handlers

* add to route handlers

* separate create/delete/update events

* removed useless interface
This commit is contained in:
Pedro Nasser
2016-11-28 21:00:12 -02:00
committed by C Cirello
parent 308cb25ba2
commit 2c56e7975d
8 changed files with 149 additions and 37 deletions

View File

@@ -34,7 +34,7 @@ func (s *Server) handleAppCreate(c *gin.Context) {
return
}
err = Api.FireBeforeAppUpdate(ctx, wapp.App)
err = Api.FireBeforeAppCreate(ctx, wapp.App)
if err != nil {
log.WithError(err).Errorln(models.ErrAppsCreate)
c.JSON(http.StatusInternalServerError, simpleError(err))
@@ -48,7 +48,7 @@ func (s *Server) handleAppCreate(c *gin.Context) {
return
}
err = Api.FireAfterAppUpdate(ctx, wapp.App)
err = Api.FireAfterAppCreate(ctx, wapp.App)
if err != nil {
log.WithError(err).Errorln(models.ErrAppsCreate)
c.JSON(http.StatusInternalServerError, simpleError(err))