mirror of
https://github.com/documenso/documenso.git
synced 2025-11-17 18:21:32 +10:00
chore: throw error if response not ok
This commit is contained in:
@ -31,6 +31,10 @@ export const DocumentAuditLogDownloadButton = ({
|
|||||||
try {
|
try {
|
||||||
const response = await fetch(`/api/t/${team.url}/download/audit-logs/${documentId}`);
|
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 contentDisposition = response.headers.get('Content-Disposition');
|
||||||
const filename =
|
const filename =
|
||||||
contentDisposition?.split('filename="')[1]?.split('"')[0] ||
|
contentDisposition?.split('filename="')[1]?.split('"')[0] ||
|
||||||
|
|||||||
Reference in New Issue
Block a user