mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-09-09 11:15:08 +08:00
Add halt tree, and copy message id features (#1088)
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import { withRole } from "src/lib/auth";
|
||||
import { createApiClient } from "src/lib/oasst_client_factory";
|
||||
|
||||
const handler = withRole("admin", async (req, res, token) => {
|
||||
const { id } = req.query;
|
||||
try {
|
||||
const client = await createApiClient(token);
|
||||
await client.stop_tree(id as string);
|
||||
res.status(200).json({ message: `Tree ${id} stopped`, id });
|
||||
} catch (e) {
|
||||
res.status(500).json(e);
|
||||
}
|
||||
});
|
||||
|
||||
export default handler;
|
||||
Reference in New Issue
Block a user