Add error logging and fix cake templates

This commit is contained in:
bronku 2025-03-27 08:22:04 +01:00
parent d9bcdfe186
commit 47a1ec95b8
4 changed files with 6 additions and 2 deletions

View file

@ -29,6 +29,7 @@ func (h *Server) postCake(r *http.Request) (any, int, error) {
n.Category = r.FormValue("category")
n.Availability = r.FormValue("availibility")
n.ID, err = h.s.SaveCake(n)
fmt.Println(err)
return n, http.StatusAccepted, err
}

View file

@ -1,5 +1,5 @@
<header>
<h1>New Order</h1>
<h1>New Cake</h1>
</header>
<nav>
<a href="/cakes">back</a>

View file

@ -3,7 +3,7 @@
</header>
<nav>
<a href="/">orders</a>
<a href="cakes">Manage Cakes</a>
<a href="cake">new</a>
</nav>
<main>
<table>