File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
backend/typescript/graphql/resolvers Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change 11import ApplicantRecordService from "../../services/implementations/applicantRecordService" ;
22import IApplicantRecordService from "../../services/interfaces/applicantRecordService" ;
33import { ApplicantRecordDTO } from "../../types" ;
4+ import { getErrorMessage } from "../../utilities/errorUtils" ;
45
56const applicantRecordService : IApplicantRecordService =
67 new ApplicantRecordService ( ) ;
@@ -14,12 +15,16 @@ const applicantRecordResolvers = {
1415 flagValue,
1516 } : { applicantRecordId : string ; flagValue : boolean } ,
1617 ) : Promise < ApplicantRecordDTO > => {
17- const applicantRecord =
18- await applicantRecordService . setApplicantRecordFlag (
19- applicantRecordId ,
20- flagValue ,
21- ) ;
22- return applicantRecord ;
18+ try {
19+ const applicantRecord =
20+ await applicantRecordService . setApplicantRecordFlag (
21+ applicantRecordId ,
22+ flagValue ,
23+ ) ;
24+ return applicantRecord ;
25+ } catch ( error : unknown ) {
26+ throw new Error ( getErrorMessage ( error ) ) ;
27+ }
2328 } ,
2429 } ,
2530} ;
You can’t perform that action at this time.
0 commit comments