trying to fix price

This commit is contained in:
bronkuu 2026-06-15 13:34:18 +02:00
parent 7feee7f8a3
commit 8194cea85e
10 changed files with 145 additions and 54 deletions

View file

@ -25,7 +25,7 @@ func (h *Server) postCake(r *http.Request) (templ.Component, int, error) {
return nil, http.StatusBadRequest, err
}
n.Name = r.FormValue("name")
n.Price, err = strconv.Atoi(r.FormValue("price"))
n.Price, err = models.ParsePrice(r.FormValue("price"))
if err != nil {
return nil, http.StatusBadRequest, err
}
@ -49,7 +49,7 @@ func (h *Server) postOrder(r *http.Request) (templ.Component, int, error) {
if err != nil {
return nil, http.StatusBadRequest, err
}
n.Paid, err = strconv.Atoi(r.FormValue("paid"))
n.Paid, err = models.ParsePrice(r.FormValue("paid"))
if err != nil {
return nil, http.StatusBadRequest, err
}