Resolved missing Vehicle info on Import IO-440
This commit is contained in:
@@ -73,12 +73,16 @@ export function JobsAvailableContainer({
|
|||||||
})
|
})
|
||||||
).data;
|
).data;
|
||||||
|
|
||||||
const existingVehicles = await client.query({
|
let existingVehicles;
|
||||||
query: SEARCH_VEHICLE_BY_VIN,
|
if (estData.data.available_jobs_by_pk.est_data.vehicle) {
|
||||||
variables: {
|
//There's vehicle data, need to double check the VIN.
|
||||||
vin: estData.data.available_jobs_by_pk.est_data.vehicle.data.v_vin,
|
existingVehicles = await client.query({
|
||||||
},
|
query: SEARCH_VEHICLE_BY_VIN,
|
||||||
});
|
variables: {
|
||||||
|
vin: estData.data.available_jobs_by_pk.est_data.vehicle.data.v_vin,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const newJob = {
|
const newJob = {
|
||||||
...estData.data.available_jobs_by_pk.est_data,
|
...estData.data.available_jobs_by_pk.est_data,
|
||||||
@@ -86,7 +90,7 @@ export function JobsAvailableContainer({
|
|||||||
owner_owing: Dinero(newTotals.totals.custPayable.total).toFormat("0.00"),
|
owner_owing: Dinero(newTotals.totals.custPayable.total).toFormat("0.00"),
|
||||||
job_totals: newTotals,
|
job_totals: newTotals,
|
||||||
queued_for_parts: true,
|
queued_for_parts: true,
|
||||||
...(existingVehicles.data.vehicles.length > 0
|
...(existingVehicles && existingVehicles.data.vehicles.length > 0
|
||||||
? { vehicleid: existingVehicles.data.vehicles[0].id, vehicle: null }
|
? { vehicleid: existingVehicles.data.vehicles[0].id, vehicle: null }
|
||||||
: {}),
|
: {}),
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user