crm finish
This commit is contained in:
@@ -16,6 +16,7 @@ import type {
|
||||
CrmCustomerHierarchyOptionDto,
|
||||
CrmRecordDetailDto,
|
||||
CrmRecordInput,
|
||||
CrmLifecycleStage,
|
||||
CrmRecordStatus,
|
||||
CrmRecordSummaryDto,
|
||||
} from "@mrp/shared/dist/crm/types.js";
|
||||
@@ -121,12 +122,32 @@ export const api = {
|
||||
token
|
||||
);
|
||||
},
|
||||
getCustomers(token: string, filters?: { q?: string; status?: CrmRecordStatus; state?: string }) {
|
||||
deleteAttachment(token: string, fileId: string) {
|
||||
return request<FileAttachmentDto>(
|
||||
`/api/v1/files/${fileId}`,
|
||||
{
|
||||
method: "DELETE",
|
||||
},
|
||||
token
|
||||
);
|
||||
},
|
||||
getCustomers(
|
||||
token: string,
|
||||
filters?: {
|
||||
q?: string;
|
||||
status?: CrmRecordStatus;
|
||||
lifecycleStage?: CrmLifecycleStage;
|
||||
state?: string;
|
||||
flag?: "PREFERRED" | "STRATEGIC" | "REQUIRES_APPROVAL" | "BLOCKED";
|
||||
}
|
||||
) {
|
||||
return request<CrmRecordSummaryDto[]>(
|
||||
`/api/v1/crm/customers${buildQueryString({
|
||||
q: filters?.q,
|
||||
status: filters?.status,
|
||||
lifecycleStage: filters?.lifecycleStage,
|
||||
state: filters?.state,
|
||||
flag: filters?.flag,
|
||||
})}`,
|
||||
undefined,
|
||||
token
|
||||
@@ -184,12 +205,23 @@ export const api = {
|
||||
token
|
||||
);
|
||||
},
|
||||
getVendors(token: string, filters?: { q?: string; status?: CrmRecordStatus; state?: string }) {
|
||||
getVendors(
|
||||
token: string,
|
||||
filters?: {
|
||||
q?: string;
|
||||
status?: CrmRecordStatus;
|
||||
lifecycleStage?: CrmLifecycleStage;
|
||||
state?: string;
|
||||
flag?: "PREFERRED" | "STRATEGIC" | "REQUIRES_APPROVAL" | "BLOCKED";
|
||||
}
|
||||
) {
|
||||
return request<CrmRecordSummaryDto[]>(
|
||||
`/api/v1/crm/vendors${buildQueryString({
|
||||
q: filters?.q,
|
||||
status: filters?.status,
|
||||
lifecycleStage: filters?.lifecycleStage,
|
||||
state: filters?.state,
|
||||
flag: filters?.flag,
|
||||
})}`,
|
||||
undefined,
|
||||
token
|
||||
|
||||
Reference in New Issue
Block a user