bottin/handlers/seed.go
2023-09-18 22:55:40 -04:00

25 lines
456 B
Go

package handlers
import (
"net/http"
"github.com/labstack/echo/v4"
)
func (h *Handler) PostSeed(c echo.Context) error {
rows, err := h.DataClient.Seed()
if err != nil {
return c.JSON(http.StatusInternalServerError, map[string]string{
"message": "Seed failed",
"error": err.Error(),
})
}
return c.JSON(http.StatusOK, map[string]interface{}{
"message": "Seed successful",
"data": map[string]interface{}{
"rows": rows,
},
})
}