IO-1469 Add keep schedule details to job detail reschedule.

This commit is contained in:
Patrick Fic
2021-10-21 14:30:50 -07:00
parent 3ece5e0ba2
commit 434ed46b5a
4 changed files with 20 additions and 4 deletions

View File

@@ -101,6 +101,7 @@ export function JobsDetailHeaderActions({
context: {
jobId: job.id,
job: job,
alt_transport: job.alt_transport,
},
});
}}

View File

@@ -63,6 +63,20 @@ export function ScheduleJobModalContainer({
skip: !visible || !!!jobId,
});
useEffect(() => {
if (
existingAppointments.data &&
existingAppointments.data.appointments.length > 0 &&
!existingAppointments.data.appointments[0].canceled
) {
form.setFieldsValue({
color: existingAppointments.data.appointments[0].color,
note: existingAppointments.data.appointments[0].note,
});
}
}, [existingAppointments.data, form]);
const handleFinish = async (values) => {
logImEXEvent("schedule_new_appointment");