- the great reformat

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2024-02-06 18:20:58 -05:00
parent 30c530bcc4
commit e83badb454
912 changed files with 108516 additions and 107493 deletions

View File

@@ -1,26 +1,26 @@
import { useQuery } from "@apollo/client";
import React, { useContext } from "react";
import { SEARCH_VEHICLES } from "../../graphql/vehicles.queries";
import {useQuery} from "@apollo/client";
import React, {useContext} from "react";
import {SEARCH_VEHICLES} from "../../graphql/vehicles.queries";
import JobCreateContext from "../../pages/jobs-create/jobs-create.context";
import AlertComponent from "../alert/alert.component";
import JobsCreateVehicleInfoComponent from "./jobs-create-vehicle-info.component";
export default function JobsCreateVehicleInfoContainer({ form }) {
const [state] = useContext(JobCreateContext);
const { loading, error, data } = useQuery(SEARCH_VEHICLES, {
variables: { search: `%${state.vehicle.search}%` },
skip: !state.vehicle.search,
fetchPolicy: "network-only",
nextFetchPolicy: "network-only",
});
export default function JobsCreateVehicleInfoContainer({form}) {
const [state] = useContext(JobCreateContext);
const {loading, error, data} = useQuery(SEARCH_VEHICLES, {
variables: {search: `%${state.vehicle.search}%`},
skip: !state.vehicle.search,
fetchPolicy: "network-only",
nextFetchPolicy: "network-only",
});
if (error) return <AlertComponent message={error.message} type="error" />;
if (error) return <AlertComponent message={error.message} type="error"/>;
return (
<JobsCreateVehicleInfoComponent
loading={loading}
vehicles={data ? data.search_vehicles : null}
form={form}
/>
);
return (
<JobsCreateVehicleInfoComponent
loading={loading}
vehicles={data ? data.search_vehicles : null}
form={form}
/>
);
}