Fixed: [弱掃] p19.2 Bad use of null-like value
| | |
| | | |
| | | |
| | | // 嚴選配對 |
| | | async strictQuery(data:StrictQueryParams): Promise<AgentOfStrictQuery[]>{ |
| | | return http.post('/consultant/strictQuery', data).then((res) => res.data); |
| | | async strictQuery(data: StrictQueryParams): Promise<AgentOfStrictQuery[]> { |
| | | try { |
| | | const response = await http.post('/consultant/strictQuery', 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 strict query:', error); |
| | | // 可以在此處處理錯誤或回傳預設值 |
| | | throw error; |
| | | } |
| | | } |
| | | |
| | | |
| | | // 加入顧問 |
| | | async addFavoriteConsultant(addFavoriteConsultantList: AddFavoriteConsultantItem[]) { |
| | | const payload = { |