Enable adding/removing users to list as well as add/update list items #11

Merged
robin merged 15 commits from dev into main 2026-08-20 15:55:38 +02:00
Showing only changes of commit e0ab3bb51a - Show all commits
+20
View File
@@ -0,0 +1,20 @@
package request
import (
"encoding/json"
"fmt"
"net/http"
)
func DecodeJSON[T any](r *http.Request) (T, error) {
var payload T
decoder := json.NewDecoder(r.Body)
decoder.DisallowUnknownFields()
if err := decoder.Decode(&payload); err != nil {
return payload, fmt.Errorf("error decoding payload: %w", err)
}
return payload, nil
}