Files
shanxia2.0/web-admin/src/api/crm/contact.ts
T
2026-06-01 08:21:21 +08:00

38 lines
1.2 KiB
TypeScript

import request from '@/utils/http'
export function fetchContactList(data: Record<string, any>) {
return request.post({ url: '/web/crm/contact/list', data })
}
export function fetchContactDetail(data: { id: string }) {
return request.post({ url: '/web/crm/contact/detail', data })
}
export function fetchContactsByCustomerId(data: { customerId: string | number }) {
return request.post({ url: '/web/crm/contact/byCustomer', data })
}
export function fetchCreateContact(data: Record<string, any>) {
return request.post({ url: '/web/crm/contact/add', data, showSuccessMessage: true })
}
export function fetchUpdateContact(data: Record<string, any>) {
return request.post({ url: '/web/crm/contact/update', data, showSuccessMessage: true })
}
export function fetchDeleteContact(data: { ids: string[] }) {
return request.post({ url: '/web/crm/contact/delete', data, showSuccessMessage: true })
}
export function fetchSetPrimaryContact(data: { id: string }) {
return request.post({ url: '/web/crm/contact/setPrimary', data, showSuccessMessage: true })
}
export function fetchExportContacts(data: Record<string, any>) {
return request.post({
url: '/web/crm/contact/export',
data,
responseType: 'blob'
})
}