add customer point card
This commit is contained in:
@@ -2,7 +2,15 @@ import { AttachmentAPI } from "timi-web";
|
||||
import type { BodyAreaValue, Customer } from "@/types/Customer";
|
||||
|
||||
export function getCustomerPhotoURL(customer?: Customer): string {
|
||||
const attachment = customer?.attachmentList?.find(item => item.attachType === "PHOTO");
|
||||
return getCustomerAttachmentURL(customer, "PHOTO");
|
||||
}
|
||||
|
||||
export function getCustomerPointCardURL(customer?: Customer): string {
|
||||
return getCustomerAttachmentURL(customer, "POINT_CARD");
|
||||
}
|
||||
|
||||
function getCustomerAttachmentURL(customer: Customer | undefined, attachType: string): string {
|
||||
const attachment = customer?.attachmentList?.find(item => item.attachType === attachType);
|
||||
if (!attachment?.id) {
|
||||
return "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user