mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Fix API inconsistencies (#404)
* fix api inconsistencies * handling empty format cases * code style
This commit is contained in:
@@ -86,12 +86,12 @@ func (s *Server) handleRouteCreate(c *gin.Context) {
|
||||
|
||||
}
|
||||
|
||||
_, err = Api.Datastore.InsertRoute(ctx, wroute.Route)
|
||||
route, err := Api.Datastore.InsertRoute(ctx, wroute.Route)
|
||||
if err != nil {
|
||||
log.WithError(err).Error(models.ErrRoutesCreate)
|
||||
c.JSON(http.StatusInternalServerError, simpleError(models.ErrRoutesCreate))
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(http.StatusCreated, routeResponse{"Route successfully created", wroute.Route})
|
||||
c.JSON(http.StatusCreated, routeResponse{"Route successfully created", route})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user