mirror of
https://github.com/strapi/strapi.git
synced 2025-11-01 10:23:34 +00:00
chore: removing onUploadProgress from upload plugin
This commit is contained in:
parent
d696828dfe
commit
833d0a7ccd
@ -26,14 +26,13 @@ const editAssetRequest = (asset, file, signal, onProgress, post) => {
|
||||
})
|
||||
);
|
||||
|
||||
/**
|
||||
* onProgress is not possible using native fetch
|
||||
* need to look into an alternative to make it work
|
||||
* perhaps using xhr like Axios does
|
||||
*/
|
||||
return post(endpoint, formData, {
|
||||
signal,
|
||||
onUploadProgress({ total, loaded }) {
|
||||
onProgress((loaded / total) * 100);
|
||||
},
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
}).then((res) => res.data);
|
||||
};
|
||||
|
||||
|
||||
@ -23,14 +23,13 @@ const uploadAsset = (asset, folderId, signal, onProgress, post) => {
|
||||
})
|
||||
);
|
||||
|
||||
/**
|
||||
* onProgress is not possible using native fetch
|
||||
* need to look into an alternative to make it work
|
||||
* perhaps using xhr like Axios does
|
||||
*/
|
||||
return post(endpoint, formData, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
signal,
|
||||
onUploadProgress({ total, loaded }) {
|
||||
onProgress((loaded / total) * 100);
|
||||
},
|
||||
}).then((res) => res.data);
|
||||
};
|
||||
|
||||
|
||||
@ -52,7 +52,6 @@
|
||||
"@strapi/icons": "2.0.0-beta.2",
|
||||
"@strapi/provider-upload-local": "5.0.0-beta.5",
|
||||
"@strapi/utils": "5.0.0-beta.5",
|
||||
"axios": "1.6.8",
|
||||
"byte-size": "8.1.1",
|
||||
"cropperjs": "1.6.1",
|
||||
"date-fns": "2.30.0",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user