perf(chat): 分页客服会话并拆分统计查询
This commit is contained in:
@@ -160,6 +160,16 @@ export async function fetchAdminChats(page = 1, pageSize = 50, query: AdminChatQ
|
||||
return data.data
|
||||
}
|
||||
|
||||
export async function fetchAdminChatCounts(query: AdminChatQuery = {}) {
|
||||
const params = Object.fromEntries(
|
||||
Object.entries(query).filter(([, value]) => value !== '' && value !== undefined)
|
||||
)
|
||||
const { data } = await apiClient.get<ApiResponse<AdminChatCounts>>('/admin/chats/counts', {
|
||||
params,
|
||||
})
|
||||
return data.data
|
||||
}
|
||||
|
||||
export async function fetchAdminChat(id: number) {
|
||||
const { data } = await apiClient.get<ApiResponse<ChatConversation>>(`/admin/chats/${id}`)
|
||||
return data.data
|
||||
|
||||
Reference in New Issue
Block a user