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,