adding cakes 50% working

This commit is contained in:
Bronku 2025-01-31 22:56:21 +01:00
parent a09cee09c8
commit cd7c9a9d0c
8 changed files with 57 additions and 38 deletions

View file

@ -3,8 +3,9 @@
<button hx-get="available_cakes" hx-swap="outerHTML" hx-target="closest div">back</button>
<button hx-get="cake_editor" hx-swap="innerHTML" hx-target="#cake_editor">New</button>
<div id="cakes">
{{range .Cakes}}
<button hx-get="cake_editor/{{.ID}}" hx-swap="innerHTML" hx-target="#cake_editor">{{.Name}}</button>
{{range $key, $value := .}}
<button hx-get="cake_editor/{{$key}}" hx-swap="innerHTML" hx-target="#cake_editor">{{$value.Name}}
{{$value.Price}}</button>
{{end}}
</div>
<div id="cake_editor"></div>