| | |
| | | import { getFavoriteFromStorage, setFavoriteToStorage } from '~/shared/storageConsultant'; |
| | | import { AppointmentLog } from '~/shared/models/appointment.model'; |
| | | import { AgentOfStrictQuery, StrictQueryParams } from '~/shared/models/strict-query.model'; |
| | | import { NotificationList } from '~/shared/models/reviews.model'; |
| | | |
| | | @Module |
| | | export default class Store extends VuexModule { |
| | |
| | | strictQueryList: AgentOfStrictQuery[] = []; |
| | | myConsultantList: Consultant[] = []; |
| | | |
| | | myAppointmentReviewLogList: AppointmentLog[] = []; |
| | | reviewLogList: AppointmentLog[] = []; |
| | | unReviewLogList: AppointmentLog[] = []; |
| | | notificationList: NotificationList[] = []; |
| | | |
| | | get isUserLogin() { |
| | | return this.context.getters['localStorage/isUserLogin']; |
| | |
| | | } |
| | | |
| | | @Mutation |
| | | updateMyAppointmentReviewLog(data: AppointmentLog[]) { |
| | | this.myAppointmentReviewLogList = data; |
| | | updateReviewLog(data: AppointmentLog[]) { |
| | | this.reviewLogList = data; |
| | | } |
| | | |
| | | @Mutation |
| | | updateUnReviewLog(data: AppointmentLog[]) { |
| | | this.unReviewLogList = data; |
| | | } |
| | | |
| | | @Mutation |
| | | updateNotification(data: NotificationList[]) { |
| | | this.notificationList = data; |
| | | } |
| | | |
| | | @Action |
| | |
| | | } |
| | | }); |
| | | const sortedData = dataWithLatestDate.sort((a, b) => +b.compareDate - +a.compareDate); |
| | | this.context.commit('updateMyAppointmentReviewLog', sortedData); |
| | | const reviewLog = sortedData.filter(item => item.score); |
| | | const unReviewLog = sortedData.filter(item => !item.score); |
| | | this.context.commit('updateReviewLog', reviewLog); |
| | | this.context.commit('updateUnReviewLog', unReviewLog); |
| | | }); |
| | | } |
| | | |
| | |
| | | }); |
| | | } |
| | | |
| | | @Action |
| | | storeMyPersonalNotification() { |
| | | reviewsService.getMyPersonalNotification().then(data => { |
| | | this.context.commit('updateNotification', data); |
| | | }) |
| | | } |
| | | |
| | | } |