Files
zeekay d3493033e4 feat: remove heavy deps, fix mutation hook signatures, update auth and vite config
- Replace @babel/standalone with lightweight TypeScript CDN transpiler for artifacts
- Gut PostHog analytics provider (return children passthrough)
- Update IAM client ID to hanzo-app-client-id
- Remove @vitejs/plugin-legacy, add libsodium-sumo resolve alias in vite config
- Fix all 60+ mutation hooks: remove extraneous `undefined as never` arg from onSuccess
- Trim unused deps: posthog-js, crypto-js, rxjs, react-scan, rehype-raw, katex, etc.
- Add mise.toml, update package-lock.json
2026-02-21 13:58:00 -08:00

33 lines
1002 B
TypeScript

import { type McpServer } from '@hanzo_network/hanzo-message-ts/api/mcp-servers/types';
import {
useMutation,
type UseMutationOptions,
useQueryClient,
} from '@tanstack/react-query';
import { FunctionKeyV2 } from '../../constants';
import { type DeleteMcpServerInput } from './types';
import { deleteMcpServer } from './index';
export const useDeleteMcpServer = (
options?: UseMutationOptions<McpServer, Error, DeleteMcpServerInput>,
) => {
const queryClient = useQueryClient();
return useMutation({
mutationFn: async (input: DeleteMcpServerInput) => {
const { deleted_mcp_server } = await deleteMcpServer(input);
return deleted_mcp_server;
},
...options,
onSuccess: async (data, variables, context, mutationContext) => {
await queryClient.invalidateQueries({
queryKey: [FunctionKeyV2.GET_MCP_SERVERS],
});
if (options?.onSuccess) {
await options.onSuccess(data, variables, context, mutationContext);
}
},
});
};