GET /admin/api/v2/spells/{spellId}/script
(w http.ResponseWriter, r *http.Request)
| 119 | |
| 120 | // GET /admin/api/v2/spells/{spellId}/script |
| 121 | func apiV2GetSpellScript(w http.ResponseWriter, r *http.Request) { |
| 122 | spellId := r.PathValue("spellId") |
| 123 | spec := spells.GetSpell(spellId) |
| 124 | if spec == nil { |
| 125 | writeAPIError(w, http.StatusNotFound, "spell not found: "+spellId) |
| 126 | return |
| 127 | } |
| 128 | |
| 129 | writeJSON(w, http.StatusOK, APIResponse[map[string]string]{ |
| 130 | Success: true, |
| 131 | Data: map[string]string{"script": spec.GetScript()}, |
| 132 | }) |
| 133 | } |
| 134 | |
| 135 | // PUT /admin/api/v2/spells/{spellId}/script |
| 136 | func apiV2PutSpellScript(w http.ResponseWriter, r *http.Request) { |
nothing calls this directly
no test coverage detected