Merge pull request #13370 from cortopy/upload-plugin-replace-media-await

add missing await in upload plugin
This commit is contained in:
Pierre Noël 2022-06-16 16:45:26 +01:00 committed by GitHub
commit 02768b6fff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}