From aa42f1dcfc03cd68c1b3dd5a38a341df876b2338 Mon Sep 17 00:00:00 2001 From: puriphatt Date: Tue, 10 Sep 2024 17:32:12 +0700 Subject: [PATCH] fix(01): bank warning --- src/stores/branch/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/stores/branch/index.ts b/src/stores/branch/index.ts index ee5896b3..a15f81cc 100644 --- a/src/stores/branch/index.ts +++ b/src/stores/branch/index.ts @@ -117,7 +117,7 @@ const useBranchStore = defineStore('api-branch', () => { .catch((e) => console.error(e)); } - if (res.data.bank) { + if (res.data.bank && bank) { for (let i = 0; i < bank?.length; i++) { if (bank[i].bankQr) { await api @@ -125,7 +125,7 @@ const useBranchStore = defineStore('api-branch', () => { `/branch/${res.data.id}/bank-qr/${res.data.bank[i].id}`, bank[i].bankQr, { - headers: { 'Content-Type': bank[i].bankQr.type }, + headers: { 'Content-Type': bank[i].bankQr?.type }, onUploadProgress: (e) => console.log(e), }, ) @@ -177,7 +177,7 @@ const useBranchStore = defineStore('api-branch', () => { .catch((e) => console.error(e)); } - if (res.data.bank) { + if (res.data.bank && bank) { for (let i = 0; i < bank?.length; i++) { if (bank[i].bankQr) { await api @@ -185,7 +185,7 @@ const useBranchStore = defineStore('api-branch', () => { `/branch/${res.data.id}/bank-qr/${res.data.bank[i].id}`, bank[i].bankQr, { - headers: { 'Content-Type': bank[i].bankQr.type }, + headers: { 'Content-Type': bank[i].bankQr?.type }, onUploadProgress: (e) => console.log(e), }, )