Skip to content

Commit

Permalink
add error catching for pccm template generation
Browse files Browse the repository at this point in the history
  • Loading branch information
gmrabian committed Dec 14, 2023
1 parent 6b0e928 commit 3b564e2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion services/app-api/utils/formTemplates/formTemplates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,5 +316,10 @@ export const generatePCCMTemplate = (originalReportTemplate: any) => {

const makePCCMTemplateModifications = (reportTemplate: ReportJson) => {
// Find Question C1.I.3 Program type in Section C.I and disable it
reportTemplate.routes[2].children![0].form!.fields[3].props!.disabled = true;
const programTypeQuestion =
reportTemplate.routes[2].children![0].form!.fields[3];
if (programTypeQuestion.id !== "program_type") {
throw new Error("Update PCCM logic!");
}
programTypeQuestion.props!.disabled = true;
};

0 comments on commit 3b564e2

Please sign in to comment.