Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

fix test

Sara Vieirabd3ef146f5f2
diff --git a/packages/asset-uploader/src/helpers/get-asset-path.test.ts b/packages/asset-uploader/src/helpers/get-asset-path.test.ts
index 8dc50db554..0701701e96 100644
--- a/packages/asset-uploader/src/helpers/get-asset-path.test.ts
+++ b/packages/asset-uploader/src/helpers/get-asset-path.test.ts
@@ -39,7 +39,7 @@ describe("getAssetPath", () => {
name: "test.png",
location: Location.FS,
})
- ).toBe("/public/uploads/test.png");
+ ).toBe("/uploads/test.png");
});
test("return local path with custom path", () => {
diff --git a/packages/asset-uploader/src/helpers/get-asset-path.ts b/packages/asset-uploader/src/helpers/get-asset-path.ts
index 986682e8d0..1403f9790b 100644
--- a/packages/asset-uploader/src/helpers/get-asset-path.ts
+++ b/packages/asset-uploader/src/helpers/get-asset-path.ts
@@ -7,11 +7,8 @@ const fsEnvs = fsEnvVariables.parse(process.env);
export const getAssetPath = (asset: DbAsset) => {
if (asset.location === Location.FS) {
- return path.join(
- "/",
- fsEnvs.FILE_UPLOAD_PATH.split("public")[1],
- asset.name
- );
+ const splitPath = fsEnvs.FILE_UPLOAD_PATH.split("public");
+ return path.join("/", splitPath[splitPath.length - 1], asset.name);
}
if (asset.location === Location.REMOTE && s3Envs.success) {