mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-07-26 13:07:22 +08:00
15 lines
525 B
TypeScript
15 lines
525 B
TypeScript
import { withoutRole } from "src/lib/auth";
|
|
import { oasstApiClient } from "src/lib/oasst_api_client";
|
|
import { LeaderboardTimeFrame } from "src/types/Leaderboard";
|
|
|
|
/**
|
|
* Returns the set of valid labels that can be applied to messages.
|
|
*/
|
|
const handler = withoutRole("banned", async (req, res) => {
|
|
const time_frame = (req.query.time_frame as LeaderboardTimeFrame) ?? LeaderboardTimeFrame.day;
|
|
const info = await oasstApiClient.fetch_leaderboard(time_frame);
|
|
res.status(200).json(info);
|
|
});
|
|
|
|
export default handler;
|