Shifted code back due to new bug that was introduced as a result of OOO.

This commit is contained in:
Patrick Fic
2020-01-29 14:41:22 -08:00
parent 9d9064d25f
commit 382629e235
2 changed files with 16 additions and 30 deletions

View File

@@ -85,22 +85,9 @@ namespace BodyshopUploader.Utils
private static async Task UpsertQueueItem(DTO_QueueItem item) private static async Task UpsertQueueItem(DTO_QueueItem item)
{ {
//Old Direct Insert //TODO: This should perform some sort of upsert to update the vehicle with more up to date information.
//var r = new GraphQLRequest
//{
// Query = @"
// mutation INSERT_JOB($jobInput: [jobs_insert_input!]!) {
// insert_jobs(objects: $jobInput) {
// returning {
// id
// }
// }
// }",
// Variables = new
// {
// jobInput = item.Job
// }
//};
//Add to Holding Queue //Add to Holding Queue
dynamic newJob = new JObject(); dynamic newJob = new JObject();
@@ -111,10 +98,8 @@ namespace BodyshopUploader.Utils
newJob.ownr_name = item.Job.ownr_fn.Value + " " + item.Job.ownr_ln.Value; newJob.ownr_name = item.Job.ownr_fn.Value + " " + item.Job.ownr_ln.Value;
newJob.vehicle_info = item.Job.vehicle.data.v_model_yr.Value + " " + item.Job.vehicle.data.v_make_desc.Value + " " + item.Job.vehicle.data.v_model_desc.Value; newJob.vehicle_info = item.Job.vehicle.data.v_model_yr.Value + " " + item.Job.vehicle.data.v_make_desc.Value + " " + item.Job.vehicle.data.v_model_desc.Value;
newJob.clm_no = item.Job.clm_no.Value; newJob.clm_no = item.Job.clm_no.Value;
var vv = item.Job.vehicle.data.v_vin.Value;
//TODO: This should perform some sort of upsert to update the vehicle with more up to date information. var vehuuid = await Utils.Queries.VehicleQueries.GetVehicleUuidByVin(item?.Job?.vehicle?.data?.v_vin.Value ?? "");
var vehuuid = await Utils.Queries.VehicleQueries.GetVehicleUuidByVin(vv) ;
if (!string.IsNullOrEmpty(vehuuid)) if (!string.IsNullOrEmpty(vehuuid))
{ {
newJob.est_data.vehicle = null; newJob.est_data.vehicle = null;
@@ -151,6 +136,7 @@ namespace BodyshopUploader.Utils
}); });
}); });
} }
catch (Exception Ex) catch (Exception Ex)
{ {
logger.Error("Job insert failed. Show notification"); logger.Error("Job insert failed. Show notification");

View File

@@ -208,17 +208,17 @@ namespace BodyshopUploader.ViewModels
}; };
Growler.AddNotification(_n); Growler.AddNotification(_n);
var r = new GraphQLRequest //var r = new GraphQLRequest
{ //{
Query = @" // Query = @"
query QUERY_BODYSHOPS { // query QUERY_BODYSHOPS {
bodyshops { // bodyshops {
shopname // shopname
id // id
} // }
}" // }"
}; //};
await Utils.GraphQL.ExecuteQuery(r); //await Utils.GraphQL.ExecuteQuery(r);
} }
} }
} }