fix issue

This commit is contained in:
Marshal
2026-07-17 11:38:54 +00:00
parent 801872c106
commit 221c49fcda
36 changed files with 726 additions and 355 deletions

View File

@@ -24,3 +24,20 @@ export async function downloadBookingFile(
a.click();
URL.revokeObjectURL(url);
}
/**
* GET /files/:id is authenticated (global JwtGuard) — raw browser loads
* (<img>/<iframe>/<a href>) carry no Bearer token and 401. Fetch the bytes
* through the axios client and hand the viewer a blob object URL instead.
*/
export async function fetchViewableFile(
id: string,
name: string,
): Promise<{ name: string; url: string; mimeType?: string }> {
const blob = await filesService.download(id);
return {
name,
url: URL.createObjectURL(blob),
mimeType: blob.type || undefined,
};
}