fix: restructure handler yet again #181
All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 45s
All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 45s
This commit is contained in:
@@ -7,9 +7,20 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func handleWorkout(db *sql.DB, router *http.ServeMux) {
|
||||
router.Handle("/workout", auth(db, service.HandleWorkoutPage(db)))
|
||||
router.Handle("POST /api/workout", auth(db, service.HandleWorkoutNewComp(db)))
|
||||
router.Handle("GET /api/workout", auth(db, service.HandleWorkoutGetComp(db)))
|
||||
router.Handle("DELETE /api/workout/{id}", auth(db, service.HandleWorkoutDeleteComp(db)))
|
||||
func workoutUi(db *sql.DB) http.Handler {
|
||||
router := http.NewServeMux()
|
||||
|
||||
router.Handle("/workout", service.HandleWorkoutPage(db))
|
||||
|
||||
return router
|
||||
}
|
||||
|
||||
func workoutApi(db *sql.DB) http.Handler {
|
||||
router := http.NewServeMux()
|
||||
|
||||
router.Handle("POST /api/workout", service.HandleWorkoutNewComp(db))
|
||||
router.Handle("GET /api/workout", service.HandleWorkoutGetComp(db))
|
||||
router.Handle("DELETE /api/workout/{id}", service.HandleWorkoutDeleteComp(db))
|
||||
|
||||
return router
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user