Skip to content

Commit 6eac454

Browse files
authored
Merge pull request #120 from ModusCreateOrg/ADE-66
[ADE-66] enhance report update with default values for missing fields and improved error handling
2 parents 81e5a51 + 86c5c42 commit 6eac454

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

backend/src/reports/reports.service.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,9 @@ export class ReportsService {
421421
{ field: 'summary', value: report.summary },
422422
{ field: 'confidence', value: report.confidence },
423423
{ field: 'status', value: report.status },
424-
{ field: 'missingInformation', value: report.missingInformation },
425-
{ field: 'isMedicalReport', value: report.isMedicalReport },
424+
{ field: 'missingInformation', value: report.missingInformation || [] },
425+
{ field: 'isMedicalReport', value: report.isMedicalReport || false },
426+
{ field: 'errorMessage', value: report.errorMessage || '' },
426427
{ field: 'updatedAt', value: report.updatedAt },
427428
];
428429

@@ -494,7 +495,11 @@ export class ReportsService {
494495
}
495496
}
496497

497-
throw new InternalServerErrorException(`Failed to update report with ID ${report.id}`);
498+
throw new InternalServerErrorException(
499+
`Failed to update report with ID ${report.id}${
500+
error instanceof Error && error.message ? ` ${error.message}` : ''
501+
}`,
502+
);
498503
}
499504
}
500505

0 commit comments

Comments
 (0)