feat(users): integrate user info and services APIs into 3-tab detail panel with proper padding
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
import { api } from '@/api/client'
|
||||
|
||||
export type ApiDocument = 'public' | 'admin'
|
||||
|
||||
export function fetchApiDocument(document: ApiDocument, signal?: AbortSignal) {
|
||||
return api.text(`/api/admin/v1/api-docs/${document}`, signal)
|
||||
}
|
||||
@@ -1,5 +1,12 @@
|
||||
import { api } from '@/api/client'
|
||||
import type { ApiResponse, PaginatedResponse, PlatformUser, UserListParams } from '@/api/types'
|
||||
import type {
|
||||
ApiResponse,
|
||||
PaginatedResponse,
|
||||
PlatformUser,
|
||||
UserListParams,
|
||||
UserProfileInfo,
|
||||
UserServicesResponse,
|
||||
} from '@/api/types'
|
||||
|
||||
const BASE = '/api/admin/v1/users'
|
||||
|
||||
@@ -14,3 +21,11 @@ export function fetchUserDetail(uid: string) {
|
||||
export function updateUserStatus(uid: string, status: boolean) {
|
||||
return api.put<ApiResponse<PlatformUser>>(`${BASE}/${uid}/status`, { status })
|
||||
}
|
||||
|
||||
export function fetchUserInfo(uid: string) {
|
||||
return api.get<ApiResponse<UserProfileInfo>>(`${BASE}/${uid}/info`)
|
||||
}
|
||||
|
||||
export function fetchUserServices(uid: string) {
|
||||
return api.get<ApiResponse<UserServicesResponse>>(`${BASE}/${uid}/services`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user