| | |
| | | // format contacted list |
| | | this.myConsultantList.filter((consultant) => consultant.appointments!.length) |
| | | .forEach((consultant) => { |
| | | const hasAppointment = consultant.appointments?.length; |
| | | if (hasAppointment) { |
| | | consultant.appointments!.forEach((appointment) => { |
| | | const consultantWithAppointmentId: ConsultantWithAppointmentId = { |
| | | ...consultant, |
| | | appointmentId: appointment.id, |
| | | appointmentDate: appointment.appointmentDate, |
| | | appointmentScore: appointment.satisfactionScore |
| | | }; |
| | | this.contactedList.push(consultantWithAppointmentId); |
| | | }) |
| | | } |
| | | consultant.appointments!.forEach((appointment) => { |
| | | const consultantWithAppointmentId: ConsultantWithAppointmentId = { |
| | | ...consultant, |
| | | appointmentId: appointment.id, |
| | | appointmentDate: appointment.appointmentDate, |
| | | appointmentScore: appointment.satisfactionScore |
| | | }; |
| | | this.contactedList.push(consultantWithAppointmentId); |
| | | }) |
| | | }); |
| | | |
| | | this.contactedList = this.contactedList |