adding wrapper on apps and routes create response

This commit is contained in:
Pedro Nasser
2016-08-15 23:22:35 -03:00
parent 43ab8da867
commit b57e6656d2
4 changed files with 28 additions and 8 deletions

View File

@@ -59,12 +59,12 @@ func handleRouteCreate(c *gin.Context) {
}
}
route, err := Api.Datastore.StoreRoute(wroute.Route)
_, err = Api.Datastore.StoreRoute(wroute.Route)
if err != nil {
log.WithError(err).Error(models.ErrRoutesCreate)
c.JSON(http.StatusInternalServerError, simpleError(models.ErrRoutesCreate))
return
}
c.JSON(http.StatusOK, route)
c.JSON(http.StatusCreated, routeResponse{"Route successfully created", wroute})
}