fix(01): bank warning

This commit is contained in:
puriphatt 2024-09-10 17:32:12 +07:00
parent aa8837fd23
commit aa42f1dcfc

View file

@ -117,7 +117,7 @@ const useBranchStore = defineStore('api-branch', () => {
.catch((e) => console.error(e)); .catch((e) => console.error(e));
} }
if (res.data.bank) { if (res.data.bank && bank) {
for (let i = 0; i < bank?.length; i++) { for (let i = 0; i < bank?.length; i++) {
if (bank[i].bankQr) { if (bank[i].bankQr) {
await api await api
@ -125,7 +125,7 @@ const useBranchStore = defineStore('api-branch', () => {
`/branch/${res.data.id}/bank-qr/${res.data.bank[i].id}`, `/branch/${res.data.id}/bank-qr/${res.data.bank[i].id}`,
bank[i].bankQr, bank[i].bankQr,
{ {
headers: { 'Content-Type': bank[i].bankQr.type }, headers: { 'Content-Type': bank[i].bankQr?.type },
onUploadProgress: (e) => console.log(e), onUploadProgress: (e) => console.log(e),
}, },
) )
@ -177,7 +177,7 @@ const useBranchStore = defineStore('api-branch', () => {
.catch((e) => console.error(e)); .catch((e) => console.error(e));
} }
if (res.data.bank) { if (res.data.bank && bank) {
for (let i = 0; i < bank?.length; i++) { for (let i = 0; i < bank?.length; i++) {
if (bank[i].bankQr) { if (bank[i].bankQr) {
await api await api
@ -185,7 +185,7 @@ const useBranchStore = defineStore('api-branch', () => {
`/branch/${res.data.id}/bank-qr/${res.data.bank[i].id}`, `/branch/${res.data.id}/bank-qr/${res.data.bank[i].id}`,
bank[i].bankQr, bank[i].bankQr,
{ {
headers: { 'Content-Type': bank[i].bankQr.type }, headers: { 'Content-Type': bank[i].bankQr?.type },
onUploadProgress: (e) => console.log(e), onUploadProgress: (e) => console.log(e),
}, },
) )