mirror of
https://github.com/strapi/strapi.git
synced 2026-01-08 05:04:10 +00:00
Merge pull request #13370 from cortopy/upload-plugin-replace-media-await
add missing await in upload plugin
This commit is contained in:
commit
02768b6fff
@ -255,7 +255,7 @@ module.exports = ({ strapi }) => ({
|
||||
}
|
||||
}
|
||||
|
||||
getService('provider').upload(fileData);
|
||||
await getService('provider').upload(fileData);
|
||||
|
||||
// clear old formats
|
||||
_.set(fileData, 'formats', {});
|
||||
@ -265,7 +265,7 @@ module.exports = ({ strapi }) => ({
|
||||
if (await isSupportedImage(fileData)) {
|
||||
const thumbnailFile = await generateThumbnail(fileData);
|
||||
if (thumbnailFile) {
|
||||
getService('provider').upload(thumbnailFile);
|
||||
await getService('provider').upload(thumbnailFile);
|
||||
_.set(fileData, 'formats.thumbnail', thumbnailFile);
|
||||
}
|
||||
|
||||
@ -276,7 +276,7 @@ module.exports = ({ strapi }) => ({
|
||||
|
||||
const { key, file } = format;
|
||||
|
||||
getService('provider').upload(file);
|
||||
await getService('provider').upload(file);
|
||||
|
||||
_.set(fileData, ['formats', key], file);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user