chore: throw error if response not ok

This commit is contained in:
Catalin Pit
2025-09-10 15:01:58 +03:00
parent b93b0aae64
commit 86fb6de9c3

View File

@ -31,6 +31,10 @@ export const DocumentAuditLogDownloadButton = ({
try {
const response = await fetch(`/api/t/${team.url}/download/audit-logs/${documentId}`);
if (!response.ok) {
throw new Error('Failed to download certificate');
}
const contentDisposition = response.headers.get('Content-Disposition');
const filename =
contentDisposition?.split('filename="')[1]?.split('"')[0] ||