BOD-10 BOD-12 BOD-11 WIP for Manual Job Creation.

This commit is contained in:
Patrick Fic
2020-03-18 14:31:33 -07:00
parent ec53663a1d
commit d7afe7e43f
15 changed files with 643 additions and 37 deletions

View File

@@ -0,0 +1,19 @@
import React, { useContext } from "react";
import JobsCreateVehicleInfoComponent from "./jobs-create-vehicle-info.component";
import JobCreateContext from "../../pages/jobs-create/jobs-create.context";
import { SEARCH_VEHICLE_BY_VIN } from "../../graphql/vehicles.queries";
import { useQuery } from "react-apollo";
export default function JobsCreateVehicleInfoContainer({ form }) {
const [state, setState] = useContext(JobCreateContext);
const { loading, error, data } = useQuery(SEARCH_VEHICLE_BY_VIN, {
variables: { vin: `%${state.vehicle.search}%` },
skip: !state.vehicle.search
});
return (
<JobsCreateVehicleInfoComponent
loading={loading}
vehicles={data ? data.vehicles : null}
/>
);
}