change type in PhotoScroller
This commit is contained in:
@@ -115,7 +115,8 @@
|
||||
<div class="photo-part">
|
||||
<photo-scroller
|
||||
v-model="photoList"
|
||||
:photo-items="photoItemList"
|
||||
v-model:photo-items="photoItemList"
|
||||
:edit-mode="true"
|
||||
:loading="isPhotoUploading"
|
||||
@add="capturePhoto"
|
||||
/>
|
||||
@@ -225,6 +226,7 @@ const navBarStore = useNavBarStore();
|
||||
|
||||
type EditablePhoto = {
|
||||
attachment?: Partial<Attachment>;
|
||||
attachType?: string;
|
||||
previewUrl?: string;
|
||||
tempFileId?: string;
|
||||
url: string;
|
||||
@@ -694,12 +696,15 @@ function buildTempFileIdList(): string[] {
|
||||
function buildPhotoAttachmentList(): Array<Partial<Attachment>> {
|
||||
return photoItemList.value.map((item) => {
|
||||
if (item.attachment) {
|
||||
return item.attachment;
|
||||
return {
|
||||
...item.attachment,
|
||||
attachType: item.attachType || item.attachment.attachType || "PHOTO"
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
tempFileId: item.tempFileId,
|
||||
attachType: "PHOTO"
|
||||
attachType: item.attachType || "PHOTO"
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user