fix: แก้ส่งค่างว่างของ image

This commit is contained in:
Net 2024-06-10 16:03:17 +07:00
parent fd8087a5c5
commit e83282aafa

View file

@ -145,12 +145,13 @@ const useCustomerStore = defineStore('api-customer', () => {
if (fileList) if (fileList)
return await addBranchAttachment(v.id, { file: fileList }); return await addBranchAttachment(v.id, { file: fileList });
}), }),
await axios image &&
.put(res.data.imageUploadUrl, image, { (await axios
headers: { 'Content-Type': image.type }, .put(res.data.imageUploadUrl, image, {
onUploadProgress: (e) => console.log(e), headers: { 'Content-Type': image?.type },
}) onUploadProgress: (e) => console.log(e),
.catch((e) => console.error(e)), })
.catch((e) => console.error(e))),
]); ]);
if (!res) return false; if (!res) return false;
@ -271,7 +272,7 @@ const useCustomerStore = defineStore('api-customer', () => {
Customer & { Customer & {
branch: CustomerBranch[]; branch: CustomerBranch[];
} }
>(`'/customer-branch'/${id}`, data, { >(`/customer-branch/${id}`, data, {
headers: { headers: {
'X-Session-Id': flow?.sessionId, 'X-Session-Id': flow?.sessionId,
'X-Rtid': flow?.refTransactionId, 'X-Rtid': flow?.refTransactionId,