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

@@ -3,9 +3,11 @@ package blogs
import (
"context"
"encoding/json"
"net/http"
"io"
core "fr.latosa-escrima/api/core"
"net/http"
core "fr.latosa-escrima/core"
"fr.latosa-escrima/core/models"
)
func HandleNew(w http.ResponseWriter, r *http.Request) {
@@ -17,7 +19,7 @@ func HandleNew(w http.ResponseWriter, r *http.Request) {
}.Respond(w, http.StatusNoContent)
return
}
var blog core.Blog
var blog models.Blog
if err := json.NewDecoder(r.Body).Decode(&blog); err != nil {
core.JSONError{
Status: core.Error,