Enable file upload form
Enable error boundary to catch React errors (#7) Fix warning for link noreferrer Include authorization header with file upload
This commit is contained in:
@@ -7,12 +7,13 @@ export const getCancelToken = () => {
|
||||
return token.source();
|
||||
}
|
||||
|
||||
export const uploadFile = (file, onProgress, cancelToken) => {
|
||||
export const uploadFile = (file, token, onProgress, cancelToken) => {
|
||||
const form = new FormData();
|
||||
let options = {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
'Authorization': `Bearer ${token}`,
|
||||
},
|
||||
cancelToken,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user