mirror of
https://github.com/docmost/docmost.git
synced 2025-11-15 10:01:12 +10:00
Add api prefix to attachment nodes
This commit is contained in:
@ -53,7 +53,16 @@ export function getSpaceUrl(spaceSlug: string) {
|
||||
}
|
||||
|
||||
export function getFileUrl(src: string) {
|
||||
return src?.startsWith("/files/") ? getBackendUrl() + src : src;
|
||||
if (!src) return src;
|
||||
if (src.startsWith("http")) return src;
|
||||
if (src.startsWith("/api/")) {
|
||||
// Remove the '/api' prefix
|
||||
return getBackendUrl() + src.substring(4);
|
||||
}
|
||||
if (src.startsWith("/files/")) {
|
||||
return getBackendUrl() + src;
|
||||
}
|
||||
return src;
|
||||
}
|
||||
|
||||
export function getFileUploadSizeLimit() {
|
||||
|
||||
Reference in New Issue
Block a user