From 3562dd00d96d21caa176008c214034bff37a495c Mon Sep 17 00:00:00 2001 From: QQ Date: Thu, 12 Nov 2026 09:23:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20src/routes.ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/routes.ts b/src/routes.ts index c2cfe22..63665c7 100644 --- a/src/routes.ts +++ b/src/routes.ts @@ -679,6 +679,7 @@ async function serveSkills(deps: RouteDeps, req: IncomingMessage, res: ServerRes // base URL; they are grouped here because they never touch a skill folder // directly (except the DSH park/unpark the group manager delegates). const groupActions: Record = { + '/import': async (body) => ({ ...(await requireGroups(deps).importSkill(body.sourceId, body.folder)) }), '/groups/create': async (body) => ({ ...(await requireGroups(deps).createGroup(body.sourceId, body.name)) }), '/groups/rename': async (body) => ({ ...(await requireGroups(deps).renameGroup(body.sourceId, body.groupId, body.name)) }), '/groups/delete': async (body) => ({ ...(await requireGroups(deps).deleteGroup(body.sourceId, body.groupId)) }), @@ -722,6 +723,8 @@ function groupStatus(code: string): number { case 'unknown_source': return 404 case 'invalid_name': case 'duplicate': + case 'import_from_self': + case 'invalid_skill': case 'too_many': return 400 case 'unavailable': return 503 default: return 500