handleEntityUninstall removes an entity (skill/agent/plugin) from the registry and its installed filesystem locations.
(w http.ResponseWriter, r *http.Request)
| 356 | // handleEntityUninstall removes an entity (skill/agent/plugin) from the |
| 357 | // registry and its installed filesystem locations. |
| 358 | func (s *Server) handleEntityUninstall(w http.ResponseWriter, r *http.Request) { |
| 359 | if r.Method != http.MethodPost { |
| 360 | methodNotAllowed(w) |
| 361 | return |
| 362 | } |
| 363 | var input struct { |
| 364 | Kind string `json:"kind"` |
| 365 | Name string `json:"name"` |
| 366 | } |
| 367 | if err := decodeJSON(r, &input); err != nil { |
| 368 | writeError(w, http.StatusBadRequest, err.Error()) |
| 369 | return |
| 370 | } |
| 371 | if input.Kind == "" { |
| 372 | writeError(w, http.StatusBadRequest, "kind is required") |
| 373 | return |
| 374 | } |
| 375 | if input.Name == "" { |
| 376 | writeError(w, http.StatusBadRequest, "name is required") |
| 377 | return |
| 378 | } |
| 379 | result, err := s.services.Entities.Uninstall(input.Kind, input.Name) |
| 380 | if err != nil { |
| 381 | writeResult(w, nil, err) |
| 382 | return |
| 383 | } |
| 384 | writeJSON(w, result) |
| 385 | } |
| 386 | |
| 387 | func (s *Server) handleConfigFiles(w http.ResponseWriter, r *http.Request) { |
| 388 | if r.Method != http.MethodGet { |
nothing calls this directly
no test coverage detected