mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-09-09 11:15:08 +08:00
implement trollboard UI (#1301)
* implement trollboard UI * remove unneeded code * add link to user * user link in leaderboard
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import type { EmojiOp, Message } from "src/types/Conversation";
|
||||
import { LeaderboardReply, LeaderboardTimeFrame } from "src/types/Leaderboard";
|
||||
import type { AvailableTasks } from "src/types/Task";
|
||||
import { FetchTrollBoardResponse, TrollboardTimeFrame } from "src/types/Trollboard";
|
||||
import type { BackendUser, BackendUserCore, FetchUsersParams, FetchUsersResponse } from "src/types/Users";
|
||||
|
||||
export class OasstError {
|
||||
@@ -350,4 +351,10 @@ export class OasstApiClient {
|
||||
fetch_frontend_user(user: BackendUserCore) {
|
||||
return this.get<BackendUser>(`/api/v1/frontend_users/${user.auth_method}/${user.id}`);
|
||||
}
|
||||
|
||||
fetch_trollboard(time_frame: TrollboardTimeFrame, { limit }: { limit?: number }) {
|
||||
return this.get<FetchTrollBoardResponse>(`/api/v1/trollboards/${time_frame}`, {
|
||||
max_count: limit,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user