typescript issue on build resolved

This commit is contained in:
laxmanhalaki 2025-12-26 16:07:25 +05:30
parent aedba86ae3
commit 22cb42e06e
2 changed files with 6 additions and 3 deletions

View File

@ -184,6 +184,7 @@ export function Requests({ onViewRequest }: RequestsProps) {
statsEndDate ? statsEndDate.toISOString() : undefined,
undefined, // status - All Requests stats show all statuses, not filtered by status
filtersWithoutStatus?.priority,
undefined, // templateType
filtersWithoutStatus?.department,
filtersWithoutStatus?.initiator,
filtersWithoutStatus?.approver,

View File

@ -379,7 +379,7 @@ function extractFilenameFromContentDisposition(contentDisposition: string | null
// Try to extract from filename* first (RFC 5987 encoded) - preferred for non-ASCII
const filenameStarMatch = contentDisposition.match(/filename\*=UTF-8''([^;]+)/);
if (filenameStarMatch) {
if (filenameStarMatch && filenameStarMatch[1]) {
try {
return decodeURIComponent(filenameStarMatch[1]);
} catch {
@ -389,9 +389,11 @@ function extractFilenameFromContentDisposition(contentDisposition: string | null
// Fallback to regular filename (for ASCII-only filenames)
const filenameMatch = contentDisposition.match(/filename="?([^";]+)"?/);
if (filenameMatch) {
if (filenameMatch && filenameMatch.length > 1 && filenameMatch[1]) {
// Remove quotes and extract only the filename part (before any semicolon)
const extracted = filenameMatch[1].replace(/^"|"$/g, '').split(';')[0].trim();
const filenameValue: string = filenameMatch[1];
const parts = filenameValue.replace(/^"|"$/g, '').split(';');
const extracted = parts[0]?.trim();
return extracted || 'download';
}