From e471f81737e1e113f913ac615a0a368ab3ca2cd1 Mon Sep 17 00:00:00 2001
From: Mila <Mila@pollex.com.tw>
Date: 星期三, 19 一月 2022 18:09:41 +0800
Subject: [PATCH] update TODO#134465 約訪紀錄(查看更多)

---
 PAMapp/store/index.ts |   45 ++++++---------------------------------------
 1 files changed, 6 insertions(+), 39 deletions(-)

diff --git a/PAMapp/store/index.ts b/PAMapp/store/index.ts
index 73ab54c..f322519 100644
--- a/PAMapp/store/index.ts
+++ b/PAMapp/store/index.ts
@@ -1,25 +1,18 @@
-import { StrictQueryParams } from '~/shared/models/strict-query.model';
 import { Module, VuexModule, Mutation, Action } from 'vuex-module-decorators'
-
-import { getMyReviewLog } from '~/shared/api/appointment';
-import { getFavoriteFromStorage, setFavoriteToStorage } from '~/shared/storageConsultant';
 
 import myConsultantService from '~/shared/services/my-consultant.service';
 import queryConsultantService from '~/shared/services/query-consultant.service';
-import appointmentService from '~/shared/services/appointment.service';
-
+import reviewsService from '~/shared/services/reviews.service';
 import { Consultant } from '~/shared/models/consultant.model';
+import { getFavoriteFromStorage, setFavoriteToStorage } from '~/shared/storageConsultant';
 import { AppointmentLog } from '~/shared/models/appointment.model';
-import { ClientInfo } from '~/shared/models/client.model';
-import { AgentOfStrictQuery } from '~/shared/models/strict-query.model';
+import { AgentOfStrictQuery, StrictQueryParams } from '~/shared/models/strict-query.model';
+
 @Module
 export default class Store extends VuexModule {
     recommendList: Consultant[] = [];
     strictQueryList: AgentOfStrictQuery[] = [];
     myConsultantList: Consultant[] = [];
-
-    myAppointmentList: ClientInfo[] = [];
-    myNewAppointmentSum: number = 0;
 
     myAppointmentReviewLogList: AppointmentLog[] = [];
 
@@ -29,7 +22,7 @@
 
     @Mutation
     updateRecommend(data: Consultant[]) {
-        this.recommendList = data;
+      this.recommendList = data;
     }
 
     @Mutation
@@ -40,16 +33,6 @@
     @Mutation
     updateStrictQueryList(data: AgentOfStrictQuery[]) {
         this.strictQueryList = data;
-    }
-
-    @Mutation
-    updateMyAppointmentList(data: ClientInfo[]) {
-        this.myAppointmentList = data;
-    }
-
-    @Mutation
-    updateMyNewAppointmentSum(newAppointmentSum: number) {
-      this.myNewAppointmentSum = newAppointmentSum;
     }
 
     @Mutation
@@ -126,17 +109,8 @@
     }
 
     @Action
-    storeMyAppointmentList(): void {
-      appointmentService.getMyAppointmentList().then((data) => {
-            const newAppointmentSum = data.filter(item => !item.consultantViewTime || item.consultantViewTime === null).length;
-            this.context.commit('updateMyAppointmentList', data);
-            this.context.commit('updateMyNewAppointmentSum', newAppointmentSum);
-        });
-    }
-
-    @Action
     storeMyAppointmentReviewLog() {
-        getMyReviewLog().then((data) => {
+        reviewsService.getMyReviewLog().then((data) => {
             const dataWithLatestDate = data.map((item) => {
                 return {
                     ...item,
@@ -146,13 +120,6 @@
             const sortedData = dataWithLatestDate.sort((a, b) => +b.compareDate - +a.compareDate);
             this.context.commit('updateMyAppointmentReviewLog', sortedData);
         });
-    }
-
-    @Action
-    updateMyAppointment(myAppointment: ClientInfo) {
-        const data = this.myAppointmentList.filter(item => item.id !== myAppointment.id);
-        data.unshift(myAppointment);
-        this.context.commit('updateMyAppointmentList', data)
     }
 
     @Action

--
Gitblit v1.9.3