From 8ead9cc19425acfb1f64a4e135cdd7d02cb7fe35 Mon Sep 17 00:00:00 2001 From: Tomas <tomasysh@gmail.com> Date: 星期六, 05 八月 2023 18:03:03 +0800 Subject: [PATCH] Fixed: [弱掃] p18.1 Bad use of null-like value --- PAMapp/shared/services/appointment.service.ts | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/PAMapp/shared/services/appointment.service.ts b/PAMapp/shared/services/appointment.service.ts index 8094bf1..2f13c2b 100644 --- a/PAMapp/shared/services/appointment.service.ts +++ b/PAMapp/shared/services/appointment.service.ts @@ -124,7 +124,18 @@ // �憓�赤閮�� async createInterviewRecord(interviewRecordInfo: InterviewRecordInfo) { - return http.post('/interview_record/create', interviewRecordInfo).then(res => res.data); + try { + const response = await http.post('/interview_record/create', interviewRecordInfo); + if (response !== null) { + return response.data; + } else { + throw new Error('http.post returned null-like value.'); + } + } catch (error) { + console.error('An error occurred while creating interview record:', error); + // �隞亙甇方���隤斗����身�� + throw error; + } } // 靽格蝝赤閮�� -- Gitblit v1.8.0