fix: properly replace media path with public path

This commit is contained in:
Daniel Lautzenheiser 2024-04-19 13:22:04 -04:00
parent bc9e4fa422
commit 4f0771a1c2

View File

@ -306,6 +306,8 @@ export function selectMediaFilePublicPath<EF extends BaseField>(
if (mediaPath.startsWith(mediaFolder)) {
return mediaPath.replace(mediaFolder, publicFolder);
} else if (mediaPath.startsWith(trim(mediaFolder, '/'))) {
return mediaPath.replace(trim(mediaFolder, '/'), publicFolder);
}
return mediaPath;