From 5c570b5c232af7475c6206e2b978735f396f8527 Mon Sep 17 00:00:00 2001 From: Tomas <tomasysh@gmail.com> Date: 星期六, 05 八月 2023 18:15:36 +0800 Subject: [PATCH] Fixed: [弱掃] p20.2 Bad use of null-like value --- PAMapp/shared/services/appointment.service.ts | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/PAMapp/shared/services/appointment.service.ts b/PAMapp/shared/services/appointment.service.ts index 2f13c2b..3a589f3 100644 --- a/PAMapp/shared/services/appointment.service.ts +++ b/PAMapp/shared/services/appointment.service.ts @@ -119,9 +119,21 @@ // 蝝赤� API async informAppointment(appointmentInformation: ToInformAppointment) { - return http.post(`/notice/send`, appointmentInformation).then((res) => res.data); + try { + const response = await http.post(`/notice/send`, appointmentInformation); + if (response !== null) { + return response.data; + } else { + throw new Error('http.post returned null-like value.'); + } + } catch (error) { + console.error('An error occurred while informing appointment:', error); + // �隞亙甇方���隤斗����身�� + throw error; + } } + // �憓�赤閮�� async createInterviewRecord(interviewRecordInfo: InterviewRecordInfo) { try { -- Gitblit v1.8.0