From 4bfd2b9450b5778b9f67b1ed524d8a106520235f Mon Sep 17 00:00:00 2001 From: Max Richter Date: Fri, 31 Oct 2025 19:18:45 +0100 Subject: [PATCH] fix: return content of written article --- server/internal/handler/handler.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/server/internal/handler/handler.go b/server/internal/handler/handler.go index 5b09220..99f8a8b 100644 --- a/server/internal/handler/handler.go +++ b/server/internal/handler/handler.go @@ -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) {