1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-24 20:36:40 +07:00

fixed types

This commit is contained in:
muerwre 2019-08-24 16:31:10 +07:00
parent ffede9cf97
commit 9691504af6
2 changed files with 9 additions and 8 deletions

View file

@ -113,5 +113,5 @@ export interface INode {
updatedAt?: string; updatedAt?: string;
} }
export type IUploadProgressHandler = (current: number, total: number) => void; export type IUploadProgressHandler = (progress: ProgressEvent) => void;
export type IValidationErrors = Record<string, keyof typeof ERRORS>; export type IValidationErrors = Record<string, keyof typeof ERRORS>;

View file

@ -20,11 +20,12 @@ export const postUploadFile = ({
const data = new FormData(); const data = new FormData();
data.append('file', file); data.append('file', file);
return api.post( return api
API.USER.UPLOAD(target, type), .post(
data, API.USER.UPLOAD(target, type),
configWithToken(access, { onUploadProgress: onProgress }) data,
.then(resultMiddleware) configWithToken(access, { onUploadProgress: onProgress })
.catch(errorMiddleware) )
); .then(resultMiddleware)
.catch(errorMiddleware);
}; };