From b1997c51ad6800983db544555809ec52b64ac101 Mon Sep 17 00:00:00 2001 From: Methapon Metanipat Date: Thu, 26 Sep 2024 10:09:57 +0700 Subject: [PATCH] fix: type --- src/stores/customer/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/stores/customer/index.ts b/src/stores/customer/index.ts index b0a2f17f..45947074 100644 --- a/src/stores/customer/index.ts +++ b/src/stores/customer/index.ts @@ -240,7 +240,7 @@ const useCustomerStore = defineStore('api-customer', () => { async function create( data: CustomerCreate, - imgList: { + imgList?: { selectedImage: string; list: { url: string; imgFile: File | null; name: string }[]; }, @@ -277,11 +277,11 @@ const useCustomerStore = defineStore('api-customer', () => { customerId: undefined, codeCustomer: undefined, })), - selectedImage: imgList.selectedImage, + selectedImage: imgList?.selectedImage, }, ); - if (imgList.list.length > 0 && res.data.id) { + if (imgList && imgList.list.length > 0 && res.data.id) { for (let index = 0; index < imgList.list.length; index++) { const imgFile = imgList.list[index].imgFile; if (imgFile)