From 0b968d33a8d9197cff6ff2644bbcc351e48a4db3 Mon Sep 17 00:00:00 2001 From: qowevisa Date: Sun, 10 Nov 2024 08:23:45 +0200 Subject: [PATCH] Add error on binding values to JSON on create request --- handlers/user_scope_CRUD.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/handlers/user_scope_CRUD.go b/handlers/user_scope_CRUD.go index 9ffd3f8..66babd4 100644 --- a/handlers/user_scope_CRUD.go +++ b/handlers/user_scope_CRUD.go @@ -2,6 +2,7 @@ package handlers import ( "fmt" + "log" "git.qowevisa.me/Qowevisa/fin-check-api/db" "git.qowevisa.me/Qowevisa/fin-check-api/types" @@ -58,6 +59,7 @@ func CreateHandler[T db.UserIdentifiable, R any](entity T, applyChanges func(src var updates R if err := c.ShouldBindJSON(&updates); err != nil { + log.Printf("err is %v\n", err) c.JSON(400, types.ErrorResponse{Message: "Invalid request"}) return }