fix: return content of written article
All checks were successful
Build and Push Server / build-and-push (push) Successful in 2m51s

This commit is contained in:
Max Richter
2025-10-31 19:18:45 +01:00
parent dfc38e2c86
commit 4bfd2b9450

View File

@@ -2,6 +2,7 @@
package handler package handler
import ( import (
"encoding/json"
"errors" "errors"
"fmt" "fmt"
"io" "io"
@@ -87,7 +88,13 @@ func (h *Handler) post(w http.ResponseWriter, r *http.Request, target string) {
return 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) { func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {