master
Denis Ranneft 2 months ago
parent e8e03088fe
commit 94b8251dc7

@ -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") h.addLog(hero.ID, "Healed to full HP by a town healer")
writeJSON(w, http.StatusOK, map[string]any{ // Flat hero JSON — matches other /hero/* mutating endpoints (use-potion, quest claim) for the TS client.
"hero": hero, writeJSON(w, http.StatusOK, hero)
"healed": true,
"message": "You have been healed to full HP.",
})
} }
// BuyPotion handles POST /api/v1/hero/npc-buy-potion. // 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") h.addLog(hero.ID, "Purchased a Healing Potion from a merchant")
writeJSON(w, http.StatusOK, map[string]any{ writeJSON(w, http.StatusOK, hero)
"hero": hero,
"message": fmt.Sprintf("You purchased a Healing Potion for %d gold.", potionCost),
})
} }

Loading…
Cancel
Save