更新 lib/routes.js

This commit is contained in:
QQ 2026-11-12 09:23:25 +08:00
parent 8d6ec26f62
commit 9d970b4fc0
1 changed files with 3 additions and 0 deletions

View File

@ -581,6 +581,7 @@ async function serveSkills(deps, req, res) {
// 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 = {
'/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)) }),
@ -625,6 +626,8 @@ function groupStatus(code) {
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;