保誠-保戶業務員媒合平台
Tomas
2023-08-05 75e7047b4f121f39a39e4fa74449a2366f15310b
Fixed: [弱掃] p10.1 Bad use of null-like value
修改1個檔案
20 ■■■■■ 已變更過的檔案
PAMapp/shared/services/appointment.service.ts 20 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/shared/services/appointment.service.ts
@@ -87,11 +87,27 @@
    return http.delete(`/appointment/memo/${appointmentMemoId}`)
  }
  // 預約單結案, 更新結案明細
  /**
   * 預約單結案, 更新結案明細
   * @param appointmentInfo 包含結案相關資訊的物件
   * @returns 回傳結案結果
   */
  async closeAppointment(appointmentInfo: ToDoneAppointment | ToCloseAppointment) {
    return http.post(`/appointment/close`, appointmentInfo).then((res) => res.data);
    try {
      const response = await http.post(`/appointment/close`, appointmentInfo);
      if (response !== null) {
        return response.data;
      } else {
        throw new Error('http.post returned null-like value.');
      }
    } catch (error) {
      // 可以在此處處理錯誤或回傳預設值
      console.error('An error occurred while closing appointment:', error);
      throw error;
    }
  }
  // 約訪通知 API
  async informAppointment(appointmentInformation: ToInformAppointment) {
    return http.post(`/notice/send`, appointmentInformation).then((res) => res.data);