1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-26 05:16:41 +07:00

fixed uploads

This commit is contained in:
muerwre 2019-08-21 18:50:13 +07:00
parent cad4e683bc
commit 32b9a0dbbb
9 changed files with 52 additions and 37 deletions

View file

@ -9,6 +9,7 @@ export const postUploadFile = ({
file,
target = 'others',
type = 'image',
onProgress,
}: IFileWithUUID & {
access: string;
onProgress: IUploadProgressHandler;
@ -16,5 +17,9 @@ export const postUploadFile = ({
const data = new FormData();
data.append('file', file);
return api.post(API.USER.UPLOAD(target, type), data, configWithToken(access));
return api.post(
API.USER.UPLOAD(target, type),
data,
configWithToken(access, { onUploadProgress: onProgress })
);
};