refactor: put File return data at
succeed
This commit is contained in:
parent
d66c2b3469
commit
7bcdb26c4b
1 changed files with 5 additions and 1 deletions
|
|
@ -215,7 +215,7 @@ const useCustomerStore = defineStore('api-customer', () => {
|
|||
file: File;
|
||||
filename?: string;
|
||||
}) {
|
||||
await api.put(
|
||||
const res = await api.put(
|
||||
`/customer-branch/${opts.branchId}/attachment/${opts.filename || opts.file.name}`,
|
||||
opts.file,
|
||||
{
|
||||
|
|
@ -223,6 +223,10 @@ const useCustomerStore = defineStore('api-customer', () => {
|
|||
onUploadProgress: (e) => console.log(e),
|
||||
},
|
||||
);
|
||||
|
||||
if (res.status >= 400) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
async function deleteAttachment(id: string, filename: string) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue