保誠-保戶業務員媒合平台
Tomas
2023-08-05 93d8ea605204e75598b2b5bc62ea9587b7ab7d25
Fixed: [弱掃] p22.1 Bad use of null-like value
修改1個檔案
16 ■■■■ 已變更過的檔案
PAMapp/shared/services/my-consultant.service.ts 16 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/shared/services/my-consultant.service.ts
@@ -35,9 +35,21 @@
  }
  // 標記為已聯絡
  markAsContact(appointmentId: number): Promise<Appointment> {
    return http.post(`/appointment/markAsContacted/${appointmentId}`).then(res => res.data);
  async markAsContact(appointmentId: number): Promise<Appointment> {
    try {
      const response = await http.post(`/appointment/markAsContacted/${appointmentId}`);
      if (response !== null) {
        return response.data;
      } else {
        throw new Error('http.post returned null-like value.');
  }
    } catch (error) {
      console.error('An error occurred while marking appointment as contacted:', error);
      // 可以在此處處理錯誤或回傳預設值
      throw error;
    }
  }
  // 取得顧問頭像
  getConsultantAvatar(agentNo:string):Promise<string>{