create member form funcitonnal

This commit is contained in:
gom-by
2025-01-23 16:31:57 +01:00
parent f9dce4b40b
commit 788d45d8a8
4 changed files with 77 additions and 23 deletions

View File

@@ -36,6 +36,7 @@ func HandleLogin(w http.ResponseWriter, r *http.Request) {
}
body, err := io.ReadAll(r.Body)
fmt.Println(body)
if err != nil {
core.JSONError{
Status: core.Error,

View File

@@ -19,7 +19,8 @@ func HandleCreateUser(w http.ResponseWriter, r *http.Request) {
}.Respond(w, http.StatusNotAcceptable)
return
}
log.Println("body : ", body )
var user core.User
err = json.Unmarshal(body, &user)
if err != nil {
@@ -30,7 +31,7 @@ func HandleCreateUser(w http.ResponseWriter, r *http.Request) {
return
}
log.Println(user)
log.Println("User : ", user)
res, err := user.Insert(context.Background())
log.Println(res)