fix: restructure handler.go #181
All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 45s
Build and Push Docker Image / Explore-Gitea-Actions (push) Successful in 46s

This commit was merged in pull request #182.
This commit is contained in:
2024-09-15 11:38:51 +02:00
parent 1476aa9842
commit 6f22e066ab
4 changed files with 48 additions and 35 deletions

15
handler/workout.go Normal file
View File

@@ -0,0 +1,15 @@
package handler
import (
"me-fit/service"
"database/sql"
"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)))
}