fix: return content of written article
All checks were successful
Build and Push Server / build-and-push (push) Successful in 2m51s
All checks were successful
Build and Push Server / build-and-push (push) Successful in 2m51s
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
@@ -87,7 +88,13 @@ func (h *Handler) post(w http.ResponseWriter, r *http.Request, target string) {
|
||||
return
|
||||
}
|
||||
|
||||
writeJSON(w, http.StatusOK, make(map[string]any))
|
||||
var data map[string]any
|
||||
if err := json.Unmarshal(body, &data); err != nil {
|
||||
writeError(w, http.StatusInternalServerError, err)
|
||||
return
|
||||
}
|
||||
|
||||
writeJSON(w, http.StatusOK, data)
|
||||
}
|
||||
|
||||
func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
Reference in New Issue
Block a user