diff --git a/client/src/components/job-checklist/components/job-checklist-form/job-checklist-form.component.jsx b/client/src/components/job-checklist/components/job-checklist-form/job-checklist-form.component.jsx index 94a04584f..fa3483351 100644 --- a/client/src/components/job-checklist/components/job-checklist-form/job-checklist-form.component.jsx +++ b/client/src/components/job-checklist/components/job-checklist-form/job-checklist-form.component.jsx @@ -6,15 +6,15 @@ import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; import { useHistory, useLocation, useParams } from "react-router-dom"; import { createStructuredSelector } from "reselect"; +import { logImEXEvent } from "../../../../firebase/firebase.utils"; import { MARK_LATEST_APPOINTMENT_AS_ARRIVED } from "../../../../graphql/appointments.queries"; import { UPDATE_JOB } from "../../../../graphql/jobs.queries"; import { selectBodyshop, selectCurrentUser, } from "../../../../redux/user/user.selectors"; -import DateTimePicker from "../../../form-date-time-picker/form-date-time-picker.component"; import ConfigFormComponents from "../../../config-form-components/config-form-components.component"; -import { logImEXEvent } from "../../../../firebase/firebase.utils"; +import DateTimePicker from "../../../form-date-time-picker/form-date-time-picker.component"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, @@ -24,7 +24,13 @@ const mapDispatchToProps = (dispatch) => ({ //setUserLanguage: language => dispatch(setUserLanguage(language)) }); -export function JobChecklistForm({ formItems, bodyshop, currentUser, type }) { +export function JobChecklistForm({ + formItems, + bodyshop, + currentUser, + type, + job, +}) { const { t } = useTranslation(); const [intakeJob] = useMutation(UPDATE_JOB); const [loading, setLoading] = useState(false); @@ -32,6 +38,7 @@ export function JobChecklistForm({ formItems, bodyshop, currentUser, type }) { const { jobId } = useParams(); const history = useHistory(); const search = queryString.parse(useLocation().search); + const [form] = Form.useForm(); const handleFinish = async (values) => { setLoading(true); @@ -48,7 +55,7 @@ export function JobChecklistForm({ formItems, bodyshop, currentUser, type }) { ...(type === "intake" && { actual_in: new Date() }), ...(type === "intake" && { - scheduled_completion: values.scheduledCompletion, + scheduled_completion: values.scheduled_completion, }), [(type === "intake" && "intakechecklist") || @@ -59,7 +66,7 @@ export function JobChecklistForm({ formItems, bodyshop, currentUser, type }) { }, ...(type === "deliver" && { - scheduled_delivery: values.scheduledDelivery, + scheduled_delivery: values.scheduled_delivery, }), ...(type === "deliver" && values.removeFromProduction && { @@ -95,13 +102,17 @@ export function JobChecklistForm({ formItems, bodyshop, currentUser, type }) { } }; - const [form] = Form.useForm(); - return (