add contest rank.

This commit is contained in:
2023-02-09 20:23:11 +08:00
parent 6f5a4d7e66
commit 5f39ec4fd2
9 changed files with 243 additions and 23 deletions

View File

@@ -10,6 +10,7 @@ import {
function filterResult(result: Problem) {
const newResult = {
id: result.id,
_id: result._id,
title: result.title,
difficulty: DIFFICULTY[result.difficulty],
@@ -131,3 +132,15 @@ export async function getContestProblems(contestID: string) {
})
return res.data.map(filterResult)
}
export function getContestRank(
contestID: string,
query: { limit: number; offset: number }
) {
return http.get("contest_rank", {
params: {
contest_id: contestID,
...query,
},
})
}