Add admin order management with full status workflow.
This commit is contained in:
+3
-1
@@ -66,7 +66,7 @@ func main() {
|
||||
productRepo, categoryRepo, userRepo, cartRepo, orderRepo, statsRepo,
|
||||
userSession, cartSession, tmpl,
|
||||
)
|
||||
admin := handlers.NewAdminHandler(adminRepo, productRepo, categoryRepo, statsRepo, storage, adminSession, tmpl)
|
||||
admin := handlers.NewAdminHandler(adminRepo, productRepo, categoryRepo, orderRepo, statsRepo, storage, adminSession, tmpl)
|
||||
|
||||
mux := http.NewServeMux()
|
||||
mux.Handle("GET /static/", http.StripPrefix("/static/", handlers.StaticHandler()))
|
||||
@@ -103,6 +103,8 @@ func main() {
|
||||
mux.HandleFunc("GET /admin/categories", admin.CategoryList)
|
||||
mux.HandleFunc("POST /admin/categories", admin.CategoryCreate)
|
||||
mux.HandleFunc("POST /admin/categories/{id}/delete", admin.CategoryDelete)
|
||||
mux.HandleFunc("GET /admin/orders", admin.OrderList)
|
||||
mux.HandleFunc("POST /admin/orders/{id}/status", admin.OrderUpdateStatus)
|
||||
|
||||
addr := ":" + getEnv("APP_PORT", "8080")
|
||||
srv := &http.Server{
|
||||
|
||||
Reference in New Issue
Block a user