fix contest conflict.

This commit is contained in:
2023-03-16 14:49:34 +08:00
parent 51328770c6
commit 0fa885d892
15 changed files with 290 additions and 148 deletions

View File

@@ -1,22 +1,10 @@
import http from "utils/http"
import { Problem } from "~/utils/types"
export async function getProblemList(
offset = 0,
limit = 10,
searchParams: any = {}
) {
let params: any = {
paging: true,
offset,
limit,
}
Object.keys(searchParams).forEach((element) => {
if (searchParams[element]) {
params[element] = searchParams[element]
}
export async function getProblemList(offset = 0, limit = 10, keyword: string) {
const res = await http.get("admin/problem", {
params: { paging: true, offset, limit, keyword },
})
const res = await http.get("admin/problem", { params })
return {
results: res.data.results.map((result: Problem) => ({
id: result.id,
@@ -41,3 +29,9 @@ export function editProblem(problem: Problem) {
export function getProblem(id: number) {
return http.get("admin/problem", { params: { id } })
}
export function getUserList(offset = 0, limit = 10, keyword: string) {
return http.get("admin/user", {
params: { paging: true, offset, limit, keyword },
})
}