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:
parent
ffede9cf97
commit
9691504af6
2 changed files with 9 additions and 8 deletions
|
@ -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>;
|
||||||
|
|
|
@ -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);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue