organization

This commit is contained in:
Bronku 2025-01-29 11:13:59 +01:00
parent 8c3611e859
commit 1517b2eaf4
5 changed files with 38 additions and 30 deletions

22
controller/new_order.go Normal file
View file

@ -0,0 +1,22 @@
package controller
import (
"fmt"
"net/http"
)
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})
}
w.WriteHeader(http.StatusAccepted)
fmt.Println(r.Form)
_ = c.tmpl["order/post_new"].Execute(w, struct{ Status any }{Status: r.Form})
}
func (c *Controller) getNewOrder(w http.ResponseWriter, r *http.Request) {
fmt.Println("received Get request: ", r)
_ = c.tmpl["order/get_new"].Execute(w, nil)
}