refactor event
This commit is contained in:
@@ -2,11 +2,10 @@ 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") || customer?.attachmentList?.[0];
|
||||
const attachment = customer?.attachmentList?.find(item => item.attachType === "PHOTO");
|
||||
if (!attachment?.id) {
|
||||
return "";
|
||||
}
|
||||
|
||||
return AttachmentAPI.getReadURL(attachment.id);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,5 @@ export function getEventRecordPhotoURL(record?: EventRecord): string {
|
||||
if (!attachment?.id) {
|
||||
return "";
|
||||
}
|
||||
|
||||
return AttachmentAPI.getReadURL(attachment.id);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user