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

@ -3,7 +3,7 @@
<button hx-get="edit_cakes" hx-swap="outerHTML" hx-target="closest div">edit</button>
<div id="cakes">
{{range $key, $value := .}}
<button onclick="addCake('{{$key}}', '{{$value.Name}} ({{$value.Price}})')">{{$value.Name}}
<button onclick="addCake('{{$value.ID}}', '{{$value.Name}} ({{$value.Price}})')">{{$value.Name}}
{{$value.Price}}</button>
{{end}}
</div>