25 lines
524 B
Go
25 lines
524 B
Go
package handler
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/jackc/pgx/v4/pgxpool"
|
|
"net/http"
|
|
"trikotwaschliste/database"
|
|
)
|
|
|
|
func MainPage(pool *pgxpool.Pool) gin.HandlerFunc {
|
|
return func(c *gin.Context) {
|
|
c.HTML(http.StatusAccepted, "index.html", database.DbMainpage(pool))
|
|
}
|
|
}
|
|
|
|
func UploadName(pool *pgxpool.Pool) gin.HandlerFunc {
|
|
return func(c *gin.Context) {
|
|
selectedID := c.PostForm("names")
|
|
washID := c.PostForm("washid")
|
|
|
|
database.UploadName(pool, selectedID, washID)
|
|
c.Redirect(302, "/")
|
|
}
|
|
}
|