edit user.

This commit is contained in:
2023-03-20 13:53:18 +08:00
parent 0fa885d892
commit efbc21ba18
9 changed files with 181 additions and 20 deletions

View File

@@ -1,5 +1,5 @@
import http from "utils/http"
import { Problem } from "~/utils/types"
import { Problem, User } from "~/utils/types"
export async function getProblemList(offset = 0, limit = 10, keyword: string) {
const res = await http.get("admin/problem", {
@@ -35,3 +35,11 @@ export function getUserList(offset = 0, limit = 10, keyword: string) {
params: { paging: true, offset, limit, keyword },
})
}
export function deleteUsers(userIDs: number[]) {
return http.delete("admin/user", { params: { id: userIDs.join(",") } })
}
export function editUser(user: User & { password: string }) {
return http.put("admin/user", user)
}