fix: type

This commit is contained in:
Methapon Metanipat 2024-09-26 10:09:57 +07:00
parent 7fcae06d4d
commit b1997c51ad

View file

@ -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)