cart
This commit is contained in:
@@ -58,9 +58,10 @@ type Config struct {
|
||||
// App is the commerce admin control plane. Construct with New, register its
|
||||
// HTTP surface with RegisterRoutes, run background work with Start.
|
||||
type App struct {
|
||||
fs *FileServer
|
||||
hub *Hub
|
||||
cs *CustomerServer
|
||||
fs *FileServer
|
||||
hub *Hub
|
||||
cs *CustomerServer
|
||||
OnVouchersChange func(codes []string)
|
||||
}
|
||||
|
||||
// New constructs the commerce admin: it opens the cart/checkout disk event-log
|
||||
@@ -171,6 +172,7 @@ func New(cfg Config) (*App, error) {
|
||||
// apply auth or CORS — the composing host (or standalone main) wraps the mux
|
||||
// with those.
|
||||
func (a *App) RegisterRoutes(mux *http.ServeMux) {
|
||||
a.fs.OnVouchersChange = a.OnVouchersChange
|
||||
mux.HandleFunc("GET /carts", a.fs.CartsHandler)
|
||||
mux.HandleFunc("GET /cart/{id}", a.fs.CartHandler)
|
||||
mux.HandleFunc("GET /checkouts", a.fs.CheckoutsHandler)
|
||||
|
||||
Reference in New Issue
Block a user