Skip to content

Commit 3a9a09f

Browse files
committed
Fix assets URL
1 parent 7ce21d3 commit 3a9a09f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

frontend/src/utils/note.utils.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { BACKEND_URL } from "../config/backendConfig";
22

3+
const isProduction = import.meta.env.PROD;
4+
const ASSETS_PATH = isProduction ? 'notes-app/assets' : 'assets';
5+
36
export function getFileURL(userId: string, fileType: 'audio' | 'image', fileName: string) {
4-
const url = new URL(`assets/${fileType === 'image' ? 'images' : 'audio'}/${userId}/${fileName}`, BACKEND_URL)
7+
const url = new URL(`${ASSETS_PATH}/${fileType === 'image' ? 'images' : 'audio'}/${userId}/${fileName}`, BACKEND_URL)
58
return url.toString();
69
}

0 commit comments

Comments
 (0)