保誠-保戶業務員媒合平台
Tomas
2023-08-05 19df6b38f10165ef55ea0467826d2cf35345fc91
Fixed: [弱掃] p8.1 Bad use of null-like value
修改1個檔案
21 ■■■■ 已變更過的檔案
PAMapp/shared/services/reviews.service.ts 21 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/shared/services/reviews.service.ts
@@ -21,9 +21,24 @@
    return http.get('/satisfaction/getMySatisfaction').then(res => res.data);
  }
  // 顧問主動發送滿意度通知
  sendSatisfactionToClient(appointmentId: number) {
    return http.post(`/consultant/sendSatisfactionToClient/${appointmentId}`).then((res) => res);
  /**
   * 顧問主動發送滿意度通知
   * @param appointmentId 預約的ID
   * @returns 回傳發送結果
   */
  async  sendSatisfactionToClient(appointmentId: number): Promise<any> {
    try {
      const response = await http.post(`/consultant/sendSatisfactionToClient/${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 sending satisfaction to client:', error);
      throw error;
    }
  }
  // 通知小鈴鐺