Reorganization of backend + new routes

This commit is contained in:
cdricms
2025-01-29 18:09:41 +01:00
parent 7c66353e63
commit 8110172a38
67 changed files with 1124 additions and 400 deletions

View File

@@ -6,11 +6,12 @@ import (
"log"
"net/http"
core "fr.latosa-escrima/api/core"
core "fr.latosa-escrima/core"
"fr.latosa-escrima/core/models"
)
func HandleNew(w http.ResponseWriter, r *http.Request) {
var user core.User
var user models.User
err := json.NewDecoder(r.Body).Decode(&user)
if err != nil {
core.JSONError{
@@ -21,7 +22,7 @@ func HandleNew(w http.ResponseWriter, r *http.Request) {
}
log.Println("User : ", user)
res, err := user.Insert(context.Background())
res, err := user.Insert(core.DB, context.Background())
log.Println(res)
// if res == nil {
// core.JSONError{