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)
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,