Add admin order management with full status workflow.

This commit is contained in:
shop
2026-06-26 19:03:42 +03:00
parent e000264bb1
commit 361d35e6b4
12 changed files with 352 additions and 28 deletions
+3 -1
View File
@@ -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{