Merge pull request #15843 from strapi/fix/crop-asset-folder

EditAssetDialog: Only send the folderId when saving the cropped asset
This commit is contained in:
Gustav Hansen 2023-02-21 09:30:40 +01:00 committed by GitHub
commit 2acd06c23f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,7 +88,7 @@ export const PreviewBox = ({
}, [isCropImageReady, hasCropIntent, onCropStart, crop]);
const handleCropping = async () => {
const nextAsset = { ...asset, width, height };
const nextAsset = { ...asset, width, height, folder: asset.folder?.id };
const file = await produceFile(nextAsset.name, nextAsset.mime, nextAsset.updatedAt);
// Making sure that when persisting the new asset, the URL changes with width and height