Categorien werden aufgelistet.

This commit is contained in:
2023-11-19 19:49:10 +01:00
parent fa3132f61d
commit ad1b7827a1
4 changed files with 53 additions and 17 deletions

View File

@@ -3,6 +3,7 @@ package controllers
import (
"github.com/gorilla/mux"
"github.com/unrolled/render"
"moretcgshop/app/models"
"net/http"
)
@@ -18,8 +19,17 @@ func (server *Server) Categories(w http.ResponseWriter, r *http.Request) {
return
}
_ = renderer.HTML(w, http.StatusOK, "home", map[string]interface{}{
categorieModel := models.Category{}
categorien, err := categorieModel.GetCategorie(server.DB, vars["id"])
if err != nil {
println(err.Error())
return
}
_ = renderer.HTML(w, http.StatusOK, "categories", map[string]interface{}{
//"user": user,
//"sectionen": sectionen,
"categorien": categorien,
})
}