保誠-保戶業務員媒合平台
Tomas
2023-08-05 965db8f11b4ce3df0c0604cc5f008d42aa6db7d4
Fixed: [弱掃] p19.1 Bad use of null-like value
修改1個檔案
14 ■■■■■ 已變更過的檔案
PAMapp/shared/services/query-consultant.service.ts 14 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/shared/services/query-consultant.service.ts
@@ -14,9 +14,21 @@
  // 快速篩選
  async fastQuery(data: FastQueryParams): Promise<Consultant[]> {
    return http.post<Consultant[]>('/consultant/fastQuery', data).then(res => res.data);
    try {
      const response = await http.post<Consultant[]>('/consultant/fastQuery', data);
      if (response !== null) {
        return response.data;
      } else {
        throw new Error('http.post returned null-like value.');
      }
    } catch (error) {
      console.error('An error occurred while performing fast query:', error);
      // 可以在此處處理錯誤或回傳預設值
      throw error;
    }
  }
  // 嚴選配對
  async strictQuery(data:StrictQueryParams): Promise<AgentOfStrictQuery[]>{
    return http.post('/consultant/strictQuery', data).then((res) => res.data);