帐号治理-帐号管理--更新
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { apiGet, apiPatch, apiPost } from "./axios";
|
||||
import type { ApiListResponse, UserInfo } from "../types/api";
|
||||
import { apiDelete } from "./axios";
|
||||
|
||||
export const fetchUsers = (params?: Record<string, any>) =>
|
||||
apiGet<ApiListResponse<UserInfo>>("/api/v1/users", { params });
|
||||
@@ -9,3 +10,6 @@ export const createUser = (payload: { username: string; password: string; role:
|
||||
|
||||
export const updateUser = (userId: string, payload: Partial<{ role: string; is_active: boolean; password: string }>) =>
|
||||
apiPatch<UserInfo>(`/api/v1/users/${userId}`, payload);
|
||||
|
||||
export const deleteUser = (userId: string, payload: { admin_password: string }) =>
|
||||
apiDelete<void>(`/api/v1/users/${userId}`, { data: payload });
|
||||
|
||||
Reference in New Issue
Block a user