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)
{
//Old Direct Insert
//var r = new GraphQLRequest
//{
// Query = @"
// mutation INSERT_JOB($jobInput: [jobs_insert_input!]!) {
// insert_jobs(objects: $jobInput) {
// returning {
// id
// }
// }
// }",
// Variables = new
// {
// jobInput = item.Job
// }
//};
//TODO: This should perform some sort of upsert to update the vehicle with more up to date information.
//Add to Holding Queue
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.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;
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(vv) ;
var vehuuid = await Utils.Queries.VehicleQueries.GetVehicleUuidByVin(item?.Job?.vehicle?.data?.v_vin.Value ?? "");
if (!string.IsNullOrEmpty(vehuuid))
{
newJob.est_data.vehicle = null;
@@ -151,6 +136,7 @@ namespace BodyshopUploader.Utils
});
});
}
catch (Exception Ex)
{
logger.Error("Job insert failed. Show notification");

View File

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