mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user