From 94b8251dc72885dea6abb1ab61c08b21ab824694 Mon Sep 17 00:00:00 2001 From: Denis Ranneft Date: Mon, 30 Mar 2026 17:08:31 +0300 Subject: [PATCH] fix --- backend/internal/handler/npc.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/backend/internal/handler/npc.go b/backend/internal/handler/npc.go index 5c99674..38ff142 100644 --- a/backend/internal/handler/npc.go +++ b/backend/internal/handler/npc.go @@ -613,11 +613,8 @@ func (h *NPCHandler) HealHero(w http.ResponseWriter, r *http.Request) { } h.addLog(hero.ID, "Healed to full HP by a town healer") - writeJSON(w, http.StatusOK, map[string]any{ - "hero": hero, - "healed": true, - "message": "You have been healed to full HP.", - }) + // Flat hero JSON — matches other /hero/* mutating endpoints (use-potion, quest claim) for the TS client. + writeJSON(w, http.StatusOK, hero) } // BuyPotion handles POST /api/v1/hero/npc-buy-potion. @@ -666,8 +663,5 @@ func (h *NPCHandler) BuyPotion(w http.ResponseWriter, r *http.Request) { } h.addLog(hero.ID, "Purchased a Healing Potion from a merchant") - writeJSON(w, http.StatusOK, map[string]any{ - "hero": hero, - "message": fmt.Sprintf("You purchased a Healing Potion for %d gold.", potionCost), - }) + writeJSON(w, http.StatusOK, hero) }