import { http } from "./httpClient";
|
|
import { ClientInfo } from "../models/client.model";
|
|
class AppointmentService {
|
|
// 取得所有預約清單
|
async getMyAppointmentList(): Promise<ClientInfo[]> {
|
return http.get('/consultant/getMyAppointment').then(res => res.data);
|
}
|
|
// 標記為已聯絡
|
markAsContact(appointmentId: number): Promise<void> {
|
// TODO: 跟後端確認,這裡的 API 不應該傳回 void, 而是應該是更新後的資料 - Ben 2021/11/16
|
// return http.post('/appointment/markAsContacted/'+appointmentId, undefined, {headers})
|
// .then(res => res.data)
|
return http.post(`/appointment/markAsContacted/${appointmentId}`);
|
}
|
|
// 讀取預約單時觸發,紀錄讀取預約單時間
|
recordRead(appointmentId: number): Promise<void> {
|
return http.post(`/appointment/recordRead/${appointmentId}`);
|
}
|
|
}
|
|
export default new AppointmentService();
|