feat: add abort upload controller as function args
This commit is contained in:
parent
f5626f9f2e
commit
f899e909f0
1 changed files with 2 additions and 0 deletions
|
|
@ -289,6 +289,7 @@ export function manageAttachment(
|
|||
name: string;
|
||||
file: File;
|
||||
onUploadProgress?: (e: AxiosProgressEvent) => void;
|
||||
abortController?: AbortController;
|
||||
}) => {
|
||||
const res = await api.put(
|
||||
`/${base}/${opts.parentId}/attachment/${opts.name}`,
|
||||
|
|
@ -300,6 +301,7 @@ export function manageAttachment(
|
|||
: option?.onUploadProgress
|
||||
? option.onUploadProgress
|
||||
: (e) => console.log(e),
|
||||
signal: opts.abortController?.signal,
|
||||
},
|
||||
);
|
||||
if (res.status < 400) return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue