Files
JayuCloud/FM-Front/src/api/managerCustomers.ts
T

23 lines
657 B
TypeScript

import { adminApi } from '@/api/client'
import type { IdType, UserInfo } from '@/types/common'
import type { CustomerCreateRequest, CustomerPage } from '@/types/manager'
export interface CustomerListParams {
page: number
size: number
keyword?: string
hasOrder?: boolean
}
export const managerCustomersApi = {
list(params: CustomerListParams): Promise<CustomerPage> {
return adminApi.get('/manager/customers', { params })
},
detail(id: IdType): Promise<UserInfo> {
return adminApi.get(`/manager/customers/${id}`)
},
create(data: CustomerCreateRequest): Promise<IdType> {
return adminApi.post('/manager/customers', data)
}
}