Started working on the blogs
This commit is contained in:
@@ -3,7 +3,6 @@ package blogs
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
core "fr.latosa-escrima/core"
|
||||
@@ -11,14 +10,6 @@ import (
|
||||
)
|
||||
|
||||
func HandleNew(w http.ResponseWriter, r *http.Request) {
|
||||
_, err := io.ReadAll(r.Body)
|
||||
if err != nil {
|
||||
core.JSONError{
|
||||
Status: core.Error,
|
||||
Message: err.Error(),
|
||||
}.Respond(w, http.StatusNoContent)
|
||||
return
|
||||
}
|
||||
var blog models.Blog
|
||||
if err := json.NewDecoder(r.Body).Decode(&blog); err != nil {
|
||||
core.JSONError{
|
||||
|
||||
Reference in New Issue
Block a user