Add missing server delete: handler, route, and UI button
DeleteServer already existed in the store layer (refuses if clients still reference the server) but was never wired up anywhere, so there was no way to actually remove a server from the UI or API. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
9c90e3f49a
commit
0000643187
@@ -709,6 +709,19 @@ func CreateServer(db store.IStore) echo.HandlerFunc {
|
||||
}
|
||||
}
|
||||
|
||||
// RemoveServer handler deletes a server, refusing if any client still
|
||||
// references it (see store.DeleteServer). Admin-only.
|
||||
func RemoveServer(db store.IStore) echo.HandlerFunc {
|
||||
return func(c echo.Context) error {
|
||||
serverID := c.Param("id")
|
||||
if err := db.DeleteServer(serverID); err != nil {
|
||||
return c.JSON(http.StatusBadRequest, jsonHTTPResponse{false, err.Error()})
|
||||
}
|
||||
log.Infof("Removed server %s", serverID)
|
||||
return c.JSON(http.StatusOK, jsonHTTPResponse{true, "Server removed successfully"})
|
||||
}
|
||||
}
|
||||
|
||||
// NewClient handler
|
||||
func NewClient(db store.IStore) echo.HandlerFunc {
|
||||
return func(c echo.Context) error {
|
||||
|
||||
Reference in New Issue
Block a user