From 21ce139df03dbae1a1e360e4bfb83144fc13c7c6 Mon Sep 17 00:00:00 2001 From: icarus Date: Thu, 18 Sep 2025 18:10:53 +0800 Subject: [PATCH] refactor(agents): replace unimplemented mutation with simple function Replace the placeholder mutation implementation in useUpdateAgent hook with a simpler function that shows a toast notification. This removes the unnecessary query client usage for an unimplemented feature. --- .../src/hooks/agents/useUpdateAgent.ts | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/renderer/src/hooks/agents/useUpdateAgent.ts b/src/renderer/src/hooks/agents/useUpdateAgent.ts index 4bf8422c43..2d259d26b6 100644 --- a/src/renderer/src/hooks/agents/useUpdateAgent.ts +++ b/src/renderer/src/hooks/agents/useUpdateAgent.ts @@ -1,18 +1,7 @@ -import { AgentEntity } from '@renderer/types' -import { useMutation, useQueryClient } from '@tanstack/react-query' - export const useUpdateAgent = () => { - const qc = useQueryClient() - - // TODO: use api - return useMutation({ - mutationFn: async (agentUpdate: Partial & { id: string }) => { - throw new Error(`useUpdateAgent mutationFn not implemented for agent ${agentUpdate.id}`) - }, - onSuccess: (updated: AgentEntity) => { - qc.setQueryData(['todos'], (old) => - old ? old.map((t) => (t.id === updated.id ? updated : t)) : [] - ) + return { + updateAgent: () => { + window.toast.info('Not implemented') } - }) + } }