GET /admin/api/v2/spells/{spellId}
(w http.ResponseWriter, r *http.Request)
| 31 | |
| 32 | // GET /admin/api/v2/spells/{spellId} |
| 33 | func apiV2GetSpell(w http.ResponseWriter, r *http.Request) { |
| 34 | spellId := r.PathValue("spellId") |
| 35 | spec := spells.GetSpell(spellId) |
| 36 | if spec == nil { |
| 37 | writeAPIError(w, http.StatusNotFound, "spell not found: "+spellId) |
| 38 | return |
| 39 | } |
| 40 | |
| 41 | writeJSON(w, http.StatusOK, APIResponse[*spells.SpellData]{ |
| 42 | Success: true, |
| 43 | Data: spec, |
| 44 | }) |
| 45 | } |
| 46 | |
| 47 | // POST /admin/api/v2/spells |
| 48 | func apiV2CreateSpell(w http.ResponseWriter, r *http.Request) { |
nothing calls this directly
no test coverage detected