mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-05 23:44:22 +00:00
Migrate edito components
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { API_BASE_URL } from '@/types/authApi';
|
||||
import { IMAGE_EXTENSIONS } from '../types/file';
|
||||
|
||||
/**
|
||||
@@ -8,3 +9,9 @@ import { IMAGE_EXTENSIONS } from '../types/file';
|
||||
export const isImageFile = (filePath: string): boolean => {
|
||||
return IMAGE_EXTENSIONS.some((ext) => filePath.toLowerCase().endsWith(ext));
|
||||
};
|
||||
|
||||
export const getFileUrl = (workspaceName: string, filePath: string) => {
|
||||
return `${API_BASE_URL}/workspaces/${encodeURIComponent(
|
||||
workspaceName
|
||||
)}/files/${encodeURIComponent(filePath)}`;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user