Add admin index page

This commit is contained in:
structix committed 2020-10-11 23:02:57 +02:00
1 parent e5c0df6f6f
commit 2a1ef7f2cb
5 files changed
+39 -11

No files matched your search

+10
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")
}
}