Fixed: [弱掃] p22.1 Bad use of null-like value
| | |
| | | } |
| | | |
| | | // 標記為已聯絡 |
| | | 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>{ |