From e83282aafaed22353f30c60ce149a8fea318e09c Mon Sep 17 00:00:00 2001 From: Net <93821485+somnetsak123@users.noreply.github.com> Date: Mon, 10 Jun 2024 16:03:17 +0700 Subject: [PATCH] =?UTF-8?q?fix:=20=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=AA?= =?UTF-8?q?=E0=B9=88=E0=B8=87=E0=B8=84=E0=B9=88=E0=B8=B2=E0=B8=87=E0=B8=A7?= =?UTF-8?q?=E0=B9=88=E0=B8=B2=E0=B8=87=E0=B8=82=E0=B8=AD=E0=B8=87=20image?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/customer/index.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/stores/customer/index.ts b/src/stores/customer/index.ts index caca6871..92f3175c 100644 --- a/src/stores/customer/index.ts +++ b/src/stores/customer/index.ts @@ -145,12 +145,13 @@ const useCustomerStore = defineStore('api-customer', () => { if (fileList) return await addBranchAttachment(v.id, { file: fileList }); }), - await axios - .put(res.data.imageUploadUrl, image, { - headers: { 'Content-Type': image.type }, - onUploadProgress: (e) => console.log(e), - }) - .catch((e) => console.error(e)), + image && + (await axios + .put(res.data.imageUploadUrl, image, { + headers: { 'Content-Type': image?.type }, + onUploadProgress: (e) => console.log(e), + }) + .catch((e) => console.error(e))), ]); if (!res) return false; @@ -271,7 +272,7 @@ const useCustomerStore = defineStore('api-customer', () => { Customer & { branch: CustomerBranch[]; } - >(`'/customer-branch'/${id}`, data, { + >(`/customer-branch/${id}`, data, { headers: { 'X-Session-Id': flow?.sessionId, 'X-Rtid': flow?.refTransactionId,