From 30c810800159df369d75fc59637a15977c14ed7a Mon Sep 17 00:00:00 2001
From: Tomas <tomasysh@gmail.com>
Date: 星期四, 16 十二月 2021 16:32:20 +0800
Subject: [PATCH] fixed: [顧問-預約單列表] 加入 viewTime 機制

---
 PAMapp/assets/ts/services/appointment.service.ts |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/PAMapp/assets/ts/services/appointment.service.ts b/PAMapp/assets/ts/services/appointment.service.ts
index 68f8d82..b544948 100644
--- a/PAMapp/assets/ts/services/appointment.service.ts
+++ b/PAMapp/assets/ts/services/appointment.service.ts
@@ -6,7 +6,17 @@
 
   // ���������
   async getMyAppointmentList(): Promise<ClientInfo[]> {
-    return http.get('/consultant/getMyAppointment').then(res => res.data);
+    return http.get('/consultant/getMyAppointment').then((res) => {
+      const hasNewAppointment = res.data.find((appointment: ClientInfo) => !appointment.consultantViewTime);
+      if (hasNewAppointment) {
+        this.viewAllAppointment();
+      }
+      return res.data;
+    });
+  }
+
+  private viewAllAppointment(): void {
+    http.post('/consultant/record/allAppointmentsView').then();
   }
 
   // 璅�撌脰蝯�

--
Gitblit v1.8.0