mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-07-20 12:10:50 +08:00
14 lines
385 B
TypeScript
14 lines
385 B
TypeScript
import { oasstApiClient } from "src/lib/oasst_api_client";
|
|
import { withRole } from "src/lib/auth";
|
|
|
|
/**
|
|
* Returns the messages recorded by the backend for a user.
|
|
*/
|
|
const handler = withRole("admin", async (req, res) => {
|
|
const { user } = req.query;
|
|
const messages = await oasstApiClient.fetch_user_messages(user);
|
|
res.status(200).json(messages);
|
|
});
|
|
|
|
export default handler;
|