Skip to content

Commit f3c4146

Browse files
HarshHarsh
authored andcommitted
resolve build error
1 parent b54d541 commit f3c4146

File tree

9 files changed

+14
-14
lines changed

9 files changed

+14
-14
lines changed

Clients/src/application/hooks/useUserFilesMetaData.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import CustomException from "../../infrastructure/exceptions/customeException";
2222
const isCriticalApiError = (error: unknown): boolean => {
2323
if (error instanceof CustomException) {
2424
// Rate limit (429), server errors (5xx), or forbidden (403)
25-
return error.status === 429 || error.status === 403 || (error.status && error.status >= 500);
25+
return error.status === 429 || error.status === 403 || (error.status !== undefined && error.status >= 500);
2626
}
2727
return false;
2828
};

Clients/src/application/repository/approvalWorkflow.repository.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,10 @@ export async function getApprovalWorkflowsByEntityType({
6969
}): Promise<any[]> {
7070
const response = await apiServices.get(`/approval-workflows?entity_type=${entityType}`, {
7171
signal,
72-
});
72+
}) as { data?: { data?: unknown[] } | unknown[] };
7373
// Filter by entity type if the backend doesn't support query param
74-
const workflows = response.data?.data || response.data || [];
74+
const responseData = response.data as { data?: unknown[] } | unknown[] | undefined;
75+
const workflows = (responseData && typeof responseData === 'object' && 'data' in responseData ? responseData.data : responseData) || [];
7576
return Array.isArray(workflows)
7677
? workflows.filter((w: any) => w.entity_type === entityType)
7778
: [];

Clients/src/presentation/components/Drawer/ClauseDrawerDialog/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -327,11 +327,11 @@ const ISO42001ClauseDrawerDialog: React.FC<ISO42001ClauseDrawerProps> = ({
327327
// Merge and deduplicate by file ID
328328
const fileMap = new Map<string, FileData>();
329329
normalizedLinks.forEach((file) => {
330-
if (file.id) fileMap.set(file.id, file);
330+
if (file.id) fileMap.set(String(file.id), file);
331331
});
332332
linkedFiles.forEach((file) => {
333-
if (file.id && !fileMap.has(file.id)) {
334-
fileMap.set(file.id, file);
333+
if (file.id && !fileMap.has(String(file.id))) {
334+
fileMap.set(String(file.id), file);
335335
}
336336
});
337337

@@ -592,7 +592,7 @@ const ISO42001ClauseDrawerDialog: React.FC<ISO42001ClauseDrawerProps> = ({
592592
// Attach pending files after successful save
593593
if (pendingAttachFiles.length > 0 && subclause?.id) {
594594
try {
595-
const fileIds = pendingAttachFiles.map((f) => parseInt(f.id));
595+
const fileIds = pendingAttachFiles.map((f) => typeof f.id === 'number' ? f.id : parseInt(String(f.id)));
596596
await attachFilesToEntity({
597597
file_ids: fileIds,
598598
framework_type: "iso_42001",
@@ -1577,7 +1577,7 @@ const ISO42001ClauseDrawerDialog: React.FC<ISO42001ClauseDrawerProps> = ({
15771577
open={showFilePicker}
15781578
onClose={() => setShowFilePicker(false)}
15791579
onSelect={handleAttachExistingFiles}
1580-
excludeFileIds={[...evidenceFiles.map((f) => f.id), ...pendingAttachFiles.map((f) => f.id)]}
1580+
excludeFileIds={[...evidenceFiles.map((f) => String(f.id)), ...pendingAttachFiles.map((f) => String(f.id))]}
15811581
multiSelect={true}
15821582
title="Attach Existing Files as Evidence"
15831583
/>

Clients/src/presentation/components/Modals/FileManagerUpload/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ const FileManagerUploadModal: React.FC<FileManagerUploadModalProps> = ({
114114
.then((workflows) => {
115115
setApprovalWorkflows(workflows);
116116
})
117-
.catch((error) => {
117+
.catch(() => {
118118
secureLogError('Failed to load approval workflows', UPLOAD_CONTEXT);
119119
setApprovalWorkflows([]);
120120
})

Clients/src/presentation/components/Modals/RequestorApprovalModal/EntityDetailsSection.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import DetailField from "./DetailField";
1111
import {
1212
getEntityTypeConfig,
1313
isEntityDeleted,
14-
hasEntityData,
1514
EntityTypeConfig,
1615
} from "./entityTypeConfig";
1716

Clients/src/presentation/components/ProjectsList/ProjectTableView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ const ProjectTableView: React.FC<IProjectTableViewProps> = ({ projects, hidePagi
493493
id={project.id}
494494
type="use case"
495495
onEdit={() => handleEditProject(project.id)}
496-
onDelete={() => handleDeleteProject(project.id)}
496+
onDelete={() => { handleDeleteProject(project.id); }}
497497
onMouseEvent={() => {}}
498498
warningTitle="Delete this use case?"
499499
warningMessage="Note that deleting a use case will remove all data related to that use case from your system. This is permanent and non-recoverable."

Clients/src/presentation/components/Table/ReportTable/TableBody/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ const ReportTableBody: React.FC<IReportTableProps> = ({
103103
id={row.id}
104104
type="report"
105105
onMouseEvent={() => handleEditRisk()}
106-
onDelete={() => handleRemoveReport(row.id)}
106+
onDelete={() => { handleRemoveReport(row.id); }}
107107
onEdit={() => {}}
108108
onDownload={() => handleDownload(row.id, row.filename)}
109109
warningTitle="Remove this report?"

Clients/src/presentation/components/Table/VWProjectRisksTable/VWProjectRisksTableBody.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ const VWProjectRisksTableBody = ({
283283
id={row.id!}
284284
type="risk"
285285
onMouseEvent={(e) => handleEditRisk(row, e)}
286-
onDelete={() => handleDeleteRisk(row.id!)}
286+
onDelete={() => { handleDeleteRisk(row.id!); }}
287287
onEdit={() => handleEditRisk(row)}
288288
openLinkedPolicies={() => handleViewLinkedPolicies(row.id!)}
289289
warningTitle="Delete this project risk?"

Clients/src/presentation/pages/FileManager/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ const FileManager: React.FC = (): JSX.Element => {
151151
};
152152
return findInChildren(folders);
153153
};
154-
return findSiblings(folderTree, editingFolder.parent_id);
154+
return findSiblings(folderTree, editingFolder.parent_id ?? null);
155155
} else if (parentFolderForCreate) {
156156
// Creating subfolder - siblings are the parent's children
157157
return parentFolderForCreate.children.map(c => c.name);

0 commit comments

Comments
 (0)