feat(api): GET /api/tracks/{id} handler with parent metadata

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-21 07:12:11 -04:00
parent 98b4755b49
commit 8c18e44d5b
3 changed files with 151 additions and 0 deletions
+9
View File
@@ -23,3 +23,12 @@ func writeErr(w http.ResponseWriter, status int, code, message string) {
w.WriteHeader(status)
_ = json.NewEncoder(w).Encode(errorBody{Error: errorPayload{Code: code, Message: message}})
}
// writeJSON emits a 2xx response with the given body JSON-encoded. Mirrors
// writeErr's shape so handlers have one shape for success and one for
// failure.
func writeJSON(w http.ResponseWriter, status int, body any) {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(status)
_ = json.NewEncoder(w).Encode(body)
}