This commit is contained in:
Christoph K.
2026-04-07 09:49:17 +02:00
parent 063aa67615
commit 4db170b467
37 changed files with 269 additions and 48 deletions

View File

@@ -2,6 +2,8 @@ package handler
import "net/http"
// handleGetLastLog behandelt GET /api/v1/exercises/{id}/last-log.
// Gibt den zuletzt geloggten Satz der Übung zurück, oder 404 wenn noch kein Satz existiert.
func (h *Handler) handleGetLastLog(w http.ResponseWriter, r *http.Request) {
uid, err := userID(r)
if err != nil {
@@ -26,6 +28,8 @@ func (h *Handler) handleGetLastLog(w http.ResponseWriter, r *http.Request) {
writeJSON(w, http.StatusOK, lastLog)
}
// handleGetExerciseHistory behandelt GET /api/v1/exercises/{id}/history.
// Unterstützt Query-Parameter: limit (Standard: 30).
func (h *Handler) handleGetExerciseHistory(w http.ResponseWriter, r *http.Request) {
uid, err := userID(r)
if err != nil {
@@ -47,6 +51,7 @@ func (h *Handler) handleGetExerciseHistory(w http.ResponseWriter, r *http.Reques
writeJSON(w, http.StatusOK, logs)
}
// handleGetStatsOverview behandelt GET /api/v1/stats/overview.
func (h *Handler) handleGetStatsOverview(w http.ResponseWriter, r *http.Request) {
uid, err := userID(r)
if err != nil {