mirror of
https://github.com/strapi/strapi.git
synced 2025-11-06 21:29:24 +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, {
|
return post(endpoint, formData, {
|
||||||
signal,
|
signal,
|
||||||
onUploadProgress({ total, loaded }) {
|
|
||||||
onProgress((loaded / total) * 100);
|
|
||||||
},
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'multipart/form-data',
|
|
||||||
},
|
|
||||||
}).then((res) => res.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, {
|
return post(endpoint, formData, {
|
||||||
headers: {
|
|
||||||
'Content-Type': 'multipart/form-data',
|
|
||||||
},
|
|
||||||
signal,
|
signal,
|
||||||
onUploadProgress({ total, loaded }) {
|
|
||||||
onProgress((loaded / total) * 100);
|
|
||||||
},
|
|
||||||
}).then((res) => res.data);
|
}).then((res) => res.data);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -52,7 +52,6 @@
|
|||||||
"@strapi/icons": "2.0.0-beta.2",
|
"@strapi/icons": "2.0.0-beta.2",
|
||||||
"@strapi/provider-upload-local": "5.0.0-beta.5",
|
"@strapi/provider-upload-local": "5.0.0-beta.5",
|
||||||
"@strapi/utils": "5.0.0-beta.5",
|
"@strapi/utils": "5.0.0-beta.5",
|
||||||
"axios": "1.6.8",
|
|
||||||
"byte-size": "8.1.1",
|
"byte-size": "8.1.1",
|
||||||
"cropperjs": "1.6.1",
|
"cropperjs": "1.6.1",
|
||||||
"date-fns": "2.30.0",
|
"date-fns": "2.30.0",
|
||||||
|
|||||||
@ -7922,7 +7922,6 @@ __metadata:
|
|||||||
"@types/koa": "npm:2.13.4"
|
"@types/koa": "npm:2.13.4"
|
||||||
"@types/koa-range": "npm:0.3.5"
|
"@types/koa-range": "npm:0.3.5"
|
||||||
"@types/koa-static": "npm:4.0.2"
|
"@types/koa-static": "npm:4.0.2"
|
||||||
axios: "npm:1.6.8"
|
|
||||||
byte-size: "npm:8.1.1"
|
byte-size: "npm:8.1.1"
|
||||||
cropperjs: "npm:1.6.1"
|
cropperjs: "npm:1.6.1"
|
||||||
date-fns: "npm:2.30.0"
|
date-fns: "npm:2.30.0"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user