PATCH /admin/api/v1/keywords
(w http.ResponseWriter, r *http.Request)
| 17 | |
| 18 | // PATCH /admin/api/v1/keywords |
| 19 | func apiV1PatchKeywords(w http.ResponseWriter, r *http.Request) { |
| 20 | var incoming keywords.Aliases |
| 21 | if err := json.NewDecoder(r.Body).Decode(&incoming); err != nil { |
| 22 | writeAPIError(w, http.StatusBadRequest, "malformed request body: "+err.Error()) |
| 23 | return |
| 24 | } |
| 25 | |
| 26 | if err := keywords.SaveKeywords(&incoming); err != nil { |
| 27 | writeAPIError(w, http.StatusInternalServerError, err.Error()) |
| 28 | return |
| 29 | } |
| 30 | |
| 31 | writeJSON(w, http.StatusOK, APIResponse[*keywords.Aliases]{ |
| 32 | Success: true, |
| 33 | Data: keywords.GetKeywords(), |
| 34 | }) |
| 35 | } |
nothing calls this directly
no test coverage detected