| | |
| | | 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}`); |
| | | // 弱掃TEST3: 判斷 response && response.data |
| | | if (response) { |
| | | return response && 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; |
| | | } |
| | | } |
| | | |
| | | // 通知小鈴鐺 |