Update wagfarm-api/routes/log/harvest.go

This commit is contained in:
2025-04-10 19:26:06 +02:00
parent dc81f64d6e
commit 96f2a3762f

View File

@@ -6,10 +6,17 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
/* used columns:
name, date, plant, equipment
*/
func RegisterHarvestRoutes(router *gin.Engine) { func RegisterHarvestRoutes(router *gin.Engine) {
db := database.DB db := database.DB
router.GET("/harvest", func(c *gin.Context) { router.GET("/harvest", func(c *gin.Context) {
var harvests []models.Log
db.Find(&harvests)
c.JSON(http.StatusOK, types)
}) })
router.POST("/harvest", func(c *gin.Context) { router.POST("/harvest", func(c *gin.Context) {