mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 05:55:02 +00:00
feat: add publication
This commit is contained in:
@@ -11,3 +11,13 @@ export function fileViewUrl(fileId: string, download = false): string {
|
||||
const base = `${API_BASE_URL}/api/files/${fileId}`;
|
||||
return download ? `${base}?download=1` : base;
|
||||
}
|
||||
|
||||
/**
|
||||
* URL that streams a public publication's file through the API by its UUID.
|
||||
* Same reasoning as `fileViewUrl`: a presigned MinIO URL is not reachable from
|
||||
* the browser here, so the bytes are streamed through the API instead.
|
||||
*/
|
||||
export function publicationFileUrl(id: string, download = false): string {
|
||||
const base = `${API_BASE_URL}/api/publications/${id}/file`;
|
||||
return download ? `${base}?download=1` : base;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user