move id to cake struct

This commit is contained in:
Bronku 2025-02-01 07:29:24 +01:00
parent cd7c9a9d0c
commit 7515010afd
8 changed files with 20 additions and 29 deletions

View file

@ -4,7 +4,7 @@
<button hx-get="cake_editor" hx-swap="innerHTML" hx-target="#cake_editor">New</button>
<div id="cakes">
{{range $key, $value := .}}
<button hx-get="cake_editor/{{$key}}" hx-swap="innerHTML" hx-target="#cake_editor">{{$value.Name}}
<button hx-get="cake_editor/{{$value.ID}}" hx-swap="innerHTML" hx-target="#cake_editor">{{$value.Name}}
{{$value.Price}}</button>
{{end}}
</div>