From 58ec3774137df3833b91cb27d03613e792448695 Mon Sep 17 00:00:00 2001 From: WangCham <651122857@qq.com> Date: Sat, 2 May 2026 23:02:56 +0800 Subject: [PATCH] feat: add filter --- web/src/app/infra/http/CloudServiceClient.ts | 41 ++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/web/src/app/infra/http/CloudServiceClient.ts b/web/src/app/infra/http/CloudServiceClient.ts index 9193d9bd..c5b835e4 100644 --- a/web/src/app/infra/http/CloudServiceClient.ts +++ b/web/src/app/infra/http/CloudServiceClient.ts @@ -40,6 +40,47 @@ export class CloudServiceClient extends BaseHttpClient { tags_filter?: string[], type_filter?: string, ): Promise { + // Use different endpoints based on type_filter + if (type_filter === 'mcp') { + return this.post<{ mcps: PluginV4[]; total: number }>( + '/api/v1/marketplace/mcps/search', + { + query, + page, + page_size, + sort_by, + sort_order, + tags_filter, + }, + ).then((resp) => ({ + plugins: (resp.mcps || []).map((mcp) => ({ + ...mcp, + plugin_id: mcp.mcp_id || mcp.plugin_id, + type: 'mcp' as const, + })), + total: resp.total || 0, + })); + } else if (type_filter === 'skill') { + return this.post<{ skills: PluginV4[]; total: number }>( + '/api/v1/marketplace/skills/search', + { + query, + page, + page_size, + sort_by, + sort_order, + tags_filter, + }, + ).then((resp) => ({ + plugins: (resp.skills || []).map((skill) => ({ + ...skill, + plugin_id: skill.skill_id || skill.plugin_id, + type: 'skill' as const, + })), + total: resp.total || 0, + })); + } + return this.post( '/api/v1/marketplace/plugins/search', {