| | |
| | | import { ClientInfo, getMyAppointmentList, getMyReviewLog, allAppointmentsView } from '~/assets/ts/api/appointment'; |
| | | // import * as consultant from '~/assets/ts/api/consultant'; |
| | | import { recommend, AgentOfStrictQuery, getFavoriteConsultant, addFavoriteConsultant, deleteConsultant, strictQuery } from '~/assets/ts/api/consultant'; |
| | | import { Consultants } from '~/assets/ts/models/consultant.model'; |
| | | import { Consultant } from '~/assets/ts/models/consultant.model'; |
| | | import { isLogin } from '~/assets/ts/auth'; |
| | | import { AppointmentLog } from '~/assets/ts/models/appointment.model'; |
| | | import { getFavoriteFromStorage, setFavoriteToStorage } from '~/assets/ts/storageConsultant'; |
| | | |
| | | @Module |
| | | export default class Store extends VuexModule { |
| | | recommendList: Consultants[] = []; |
| | | recommendList: Consultant[] = []; |
| | | strictQueryList: AgentOfStrictQuery[] = []; |
| | | myConsultantList: Consultants[] = []; |
| | | myConsultantList: Consultant[] = []; |
| | | |
| | | myAppointmentList: ClientInfo[] = []; |
| | | |
| | | myAppointmentReviewLogList: AppointmentLog[] = []; |
| | | |
| | | @Mutation updateRecommend(data: Consultants[]) { |
| | | @Mutation updateRecommend(data: Consultant[]) { |
| | | this.recommendList = data; |
| | | } |
| | | |
| | | @Mutation updateConsultantList(data: Consultants[]) { |
| | | @Mutation updateConsultantList(data: Consultant[]) { |
| | | this.myConsultantList = data; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Action |
| | | async addToMyConsultantList(consultantToAdd: Consultants) { |
| | | async addToMyConsultantList(consultantToAdd: Consultant) { |
| | | if (consultantToAdd) { |
| | | const found = this.myConsultantList.find(item => item.agentNo === consultantToAdd.agentNo); |
| | | if (!found) { |