mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-08-15 12:05:19 +08:00
13 lines
456 B
TypeScript
13 lines
456 B
TypeScript
import { withoutRole } from "src/lib/auth";
|
|
import { createApiClientFromUser } from "src/lib/oasst_client_factory";
|
|
import { getBackendUserCore } from "src/lib/users";
|
|
|
|
const handler = withoutRole("banned", async (req, res, token) => {
|
|
const user = await getBackendUserCore(token.sub);
|
|
const client = createApiClientFromUser(user);
|
|
const messages = await client.fetch_my_messages(user);
|
|
res.status(200).json(messages);
|
|
});
|
|
|
|
export default handler;
|