更新 src/routes.ts

This commit is contained in:
QQ 2026-11-11 11:34:11 +08:00
parent 4142e275af
commit 6078ac6566
1 changed files with 1 additions and 3 deletions

View File

@ -366,7 +366,6 @@ function adminStatus(code: string): number {
* `GET /cloud-memory/skills/api` inventory JSON (skills + trash)
* `POST /cloud-memory/skills/toggle` { folder, enabled }
* `POST /cloud-memory/skills/remove` { folder }
* `POST /cloud-memory/skills/restore` { id }
* `POST /cloud-memory/skills/install` { url }
*/
async function serveSkills(deps: RouteDeps, req: IncomingMessage, res: ServerResponse): Promise<void> {
@ -401,8 +400,7 @@ async function serveSkills(deps: RouteDeps, req: IncomingMessage, res: ServerRes
}
const actions: Record<string, (body: Record<string, unknown>) => Promise<Record<string, unknown>>> = {
'/toggle': async (body) => admin.setEnabled(body.folder, body.enabled === true),
'/remove': async (body) => ({ entry: await admin.remove(body.folder) }),
'/restore': async (body) => admin.restore(body.id),
'/remove': async (body) => admin.remove(body.folder),
'/install': async (body) => admin.installFromGit(body.url),
}
const action = actions[suffix]