Add skill sync action

This commit is contained in:
wuyang6
2026-05-11 09:59:34 +08:00
parent 010dc1a88d
commit b4bd7698a4
3 changed files with 162 additions and 0 deletions
+25
View File
@@ -47,3 +47,28 @@ export async function PATCH(request: Request) {
},
});
}
export async function POST() {
const account = await getCurrentAccount();
if (!account)
return Response.json({ error: "unauthorized" }, { status: 401 });
const response = await fetch(`${CLAW_API_URL}/api/skills/sync`, {
method: "POST",
headers: {
"content-type": "application/json",
},
body: JSON.stringify({
account_id: account.id,
}),
cache: "no-store",
});
const payload = await response.text();
return new Response(payload, {
status: response.status,
headers: {
"content-type":
response.headers.get("content-type") ?? "application/json",
},
});
}