renamed confirm page
This commit is contained in:
parent
074451cec2
commit
9f858d50ae
4 changed files with 3 additions and 53 deletions
|
|
@ -14,7 +14,7 @@ type Controller struct {
|
|||
// #todo: load all automatically
|
||||
func (c *Controller) LoadTemplates(fs fs.FS) {
|
||||
c.tmpl = make(map[string]*template.Template)
|
||||
c.tmpl["order/post_new"], _ = template.ParseFS(fs, "templates/order/post_new.html")
|
||||
c.tmpl["order/confirmation"], _ = template.ParseFS(fs, "templates/order/confirmation.html")
|
||||
c.tmpl["cake/options"], _ = template.ParseFS(fs, "templates/cake/options.html")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ func (c *Controller) postNewOrder(w http.ResponseWriter, r *http.Request) {
|
|||
fmt.Println("received Post request: ", r)
|
||||
err := r.ParseForm()
|
||||
if err != nil {
|
||||
_ = c.tmpl["order/post_new"].Execute(w, struct{ Status any }{Status: err})
|
||||
_ = c.tmpl["order/confirmation"].Execute(w, struct{ Status any }{Status: err})
|
||||
}
|
||||
w.WriteHeader(http.StatusAccepted)
|
||||
fmt.Println(r.Form)
|
||||
_ = c.tmpl["order/post_new"].Execute(w, struct{ Status any }{Status: r.Form})
|
||||
_ = c.tmpl["order/confirmation"].Execute(w, struct{ Status any }{Status: r.Form})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue