Exemplo n.º 1
0
func DocumentsByCategoryHandler(context *gin.Context, database *db.Context) {
	category := context.Param("category")
	result, err := database.DocumentsByCategory(category)
	if err != nil {
		context.AbortWithError(http.StatusInternalServerError, err)
	}
	context.JSON(http.StatusOK, result)
}