Add in context to dashboard for user to topbar loads all items & refactor for clarity of variable extraction.
This commit is contained in:
@@ -13,7 +13,8 @@ import (
|
||||
|
||||
func NewDrawHandler(db *sql.DB) http.HandlerFunc {
|
||||
return httpHelpers.AuthMiddleware(func(w http.ResponseWriter, r *http.Request) {
|
||||
context := templateHelpers.TemplateContext(w, r, models.TemplateData{})
|
||||
data := models.TemplateData{}
|
||||
context := templateHelpers.TemplateContext(w, r, data)
|
||||
|
||||
if r.Method == http.MethodPost {
|
||||
game := r.FormValue("game_type")
|
||||
@@ -74,7 +75,8 @@ func DeleteDrawHandler(db *sql.DB) http.HandlerFunc {
|
||||
|
||||
func ListDrawsHandler(db *sql.DB) http.HandlerFunc {
|
||||
return httpHelpers.AuthMiddleware(func(w http.ResponseWriter, r *http.Request) {
|
||||
context := templateHelpers.TemplateContext(w, r, models.TemplateData{})
|
||||
data := models.TemplateData{}
|
||||
context := templateHelpers.TemplateContext(w, r, data)
|
||||
draws := []models.DrawSummary{}
|
||||
|
||||
rows, err := db.Query(`
|
||||
|
||||
Reference in New Issue
Block a user