refactor: agents sharing and shared with me logic

This commit is contained in:
Siddhant Rai
2025-05-28 13:58:55 +05:30
parent b7a6bad7cd
commit ad1a944276
6 changed files with 158 additions and 137 deletions

View File

@@ -286,7 +286,10 @@ function AgentCard({
const handleHideSharedAgent = async () => {
try {
const response = await userService.hideSharedAgent(agent.id ?? '', token);
const response = await userService.removeSharedAgent(
agent.id ?? '',
token,
);
if (!response.ok) throw new Error('Failed to hide shared agent');
const updatedAgents = agents.filter(
(prevAgent) => prevAgent.id !== agent.id,