mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-08-19 11:50:35 +08:00
Merge pull request #652 from LAION-AI/238-admin-view-user-messages
Displaying a different user's messages in the admin view
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { withRole } from "src/lib/auth";
|
||||
|
||||
const handler = withRole("admin", async (req, res) => {
|
||||
const { user } = req.query;
|
||||
|
||||
const messagesRes = await fetch(`${process.env.FASTAPI_URL}/api/v1/frontend_users/local/${user}/messages`, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"X-API-Key": process.env.FASTAPI_KEY,
|
||||
},
|
||||
});
|
||||
const messages = await messagesRes.json();
|
||||
res.status(200).json(messages);
|
||||
});
|
||||
|
||||
export default handler;
|
||||
Reference in New Issue
Block a user