finish breadcumbs and categories

This commit is contained in:
Aleksandr Trushkin
2024-01-11 19:17:26 +03:00
parent 067c63baa8
commit 8b8a7618a2
4 changed files with 156 additions and 101 deletions

View File

@ -33,8 +33,8 @@ func setupHTTP(cfg config.HTTP, srv xhttp.Server, log *slog.Logger) *http.Server
router.Use(mux.CORSMethodMiddleware(router))
router.Use(middlewareLogger(log))
router.HandleFunc("/updatedesc", coursesAPI.UdpateDescription).Methods(http.MethodPost)
coursesRouter := router.PathPrefix("/courses").Subrouter()
// router.HandleFunc("/updatedesc", coursesAPI.UdpateDescription).Methods(http.MethodPost)
coursesRouter := router.PathPrefix("/courses").Subrouter().StrictSlash(true)
coursesRouter.HandleFunc("/", coursesAPI.List).Methods(http.MethodGet)
coursesListLearningOnlyPath := makePathTemplate(xhttp.LearningTypePathParam)
coursesRouter.HandleFunc(coursesListLearningOnlyPath, coursesAPI.List).Methods(http.MethodGet)