| | |
| | | return http.delete(`/appointment/memo/${appointmentMemoId}`) |
| | | } |
| | | |
| | | // 預約單結案, 更新結案明細 |
| | | /** |
| | | * 預約單結案, 更新結案明細 |
| | | * @param appointmentInfo 包含結案相關資訊的物件 |
| | | * @returns 回傳結案結果 |
| | | */ |
| | | async closeAppointment(appointmentInfo: ToDoneAppointment | ToCloseAppointment) { |
| | | return http.post(`/appointment/close`, appointmentInfo).then((res) => res.data); |
| | | try { |
| | | const response = await http.post(`/appointment/close`, appointmentInfo); |
| | | if (response !== null) { |
| | | return response.data; |
| | | } else { |
| | | throw new Error('http.post returned null-like value.'); |
| | | } |
| | | } catch (error) { |
| | | // 可以在此處處理錯誤或回傳預設值 |
| | | console.error('An error occurred while closing appointment:', error); |
| | | throw error; |
| | | } |
| | | } |
| | | |
| | | |
| | | // 約訪通知 API |
| | | async informAppointment(appointmentInformation: ToInformAppointment) { |
| | | return http.post(`/notice/send`, appointmentInformation).then((res) => res.data); |