| | |
| | | get latestReservedAppointment(): Appointment { |
| | | return this.agentInfo.appointments! |
| | | .filter((appointment) => appointment.communicateStatus !== 'contacted') |
| | | .sort((preAppointment, nextAppointment) => +nextAppointment.appointmentDate - +preAppointment.appointmentDate)[0]; |
| | | .map((reversedAppointment) => { |
| | | return { |
| | | ...reversedAppointment, |
| | | sortDate: new Date(reversedAppointment.appointmentDate) |
| | | } |
| | | }) |
| | | .sort((preAppointment, nextAppointment) => +nextAppointment.sortDate - +preAppointment.sortDate)[0]; |
| | | } |
| | | |
| | | appointmentDetail: any = { |
| | |
| | | } |
| | | |
| | | openPopUp() { |
| | | getAppointmentDetail(this.latestContactedAppointment |
| | | ? this.latestContactedAppointment.id |
| | | : this.latestReservedAppointment.id).then(res => { |
| | | const appointmentId = this.agentInfo.contactStatus === 'contacted' |
| | | ? this.latestContactedAppointment?.id |
| | | : this.latestReservedAppointment.id; |
| | | |
| | | getAppointmentDetail(appointmentId!).then(res => { |
| | | this.appointmentDetail = { |
| | | ...this.appointmentDetail, |
| | | ...res.data |