| | |
| | | import { http } from "./httpClient"; |
| | | |
| | | import { AppointmentMemoInfo, ClientInfo } from "~/shared/models/client.model"; |
| | | import { AppointmentDetail, createdMemoInfo, EditAppointmentParams, updatedMemoInfo } from "~/shared/models/appointment.model"; |
| | | import { Appointment, AppointmentDetail, AppointmentMemoInfo, createdMemoInfo, EditAppointmentParams, updatedMemoInfo } from "~/shared/models/appointment.model"; |
| | | |
| | | class AppointmentService { |
| | | |
| | | // 取得所有預約清單 |
| | | async getMyAppointmentList(): Promise<ClientInfo[]> { |
| | | // 顧問取得所有自己的預約單API |
| | | async getMyAppointmentList(): Promise<Appointment[]> { |
| | | return http.get('/consultant/getMyAppointment').then((res) => { |
| | | const hasNewAppointment = res.data.find((appointment: ClientInfo) => !appointment.consultantViewTime); |
| | | const hasNewAppointment = res.data.find((appointment: Appointment) => !appointment.consultantViewTime); |
| | | if (hasNewAppointment) { |
| | | this.viewAllAppointment(); |
| | | } |
| | |
| | | }); |
| | | } |
| | | |
| | | // 顧問登入顯示新預約單筆數後觸發 |
| | | // 顧問瀏覽自己所有的預約單紀錄觸發API |
| | | private viewAllAppointment(): void { |
| | | http.post('/consultant/record/allAppointmentsView').then(); |
| | | } |