feat: add publication

This commit is contained in:
ghost2023
2026-09-04 14:43:17 +03:00
parent ad791e2074
commit 0dd0e8d992
28 changed files with 1323 additions and 10 deletions

View File

@@ -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;
}