Add admin index page

This commit is contained in:
2020-10-11 23:02:57 +02:00
parent e5c0df6f6f
commit 2a1ef7f2cb
5 changed files with 39 additions and 11 deletions

View File

@@ -12,3 +12,13 @@ func AdminMainPage(pool *pgxpool.Pool) gin.HandlerFunc {
c.HTML(http.StatusAccepted, "adminindex.html", database.DbAdminMainpage(pool))
}
}
func ChangeName(pool *pgxpool.Pool) gin.HandlerFunc {
return func(c *gin.Context) {
selectedID := c.PostForm("names")
personID := c.PostForm("personid")
database.ChangeName(pool, selectedID, personID)
c.Redirect(302, "/admin")
}
}