trying to fix price
This commit is contained in:
parent
7feee7f8a3
commit
8194cea85e
10 changed files with 145 additions and 54 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue