| | |
| | | |
| | | const appointmentInfo = agentInfo.length > 0 && agentInfo[0].appointments |
| | | ? agentInfo[0].appointments! |
| | | .filter((appointment) => appointment.communicateStatus !== 'contacted') |
| | | .sort((preAppointment, nextAppointment) => { |
| | | return +nextAppointment.appointmentDate - +preAppointment.appointmentDate |
| | | })[0] |
| | | .filter((appointment) => appointment.communicateStatus !== 'contacted') |
| | | .map((reversedAppointment) => { |
| | | return { |
| | | ...reversedAppointment, |
| | | sortDate: new Date(reversedAppointment.appointmentDate) |
| | | } |
| | | }) |
| | | .sort((preAppointment, nextAppointment) => +nextAppointment.sortDate - +preAppointment.sortDate)[0] |
| | | : null; |
| | | |
| | | return this.getReservedData(appointmentInfo); |
| | | } |
| | | |