Modified gql query to upload to available jobs instead.
This commit is contained in:
@@ -85,11 +85,39 @@ namespace BodyshopUploader.Utils
|
|||||||
|
|
||||||
private static async Task UpsertQueueItem(DTO_QueueItem item)
|
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
|
||||||
|
// }
|
||||||
|
//};
|
||||||
|
|
||||||
|
//Add to Holding Queue
|
||||||
|
|
||||||
|
dynamic newJob = new JObject();
|
||||||
|
newJob.uploaded_by = Auth.authlink.User.Email;
|
||||||
|
newJob.bodyshopid = AppMetaData.ActiveShopId;
|
||||||
|
newJob.cieca_id = item.Job.ciecaid;
|
||||||
|
newJob.est_data = item.Job;
|
||||||
|
newJob.ownr_name = item.Job.ownr_fn + " " + item.Job.ownr_ln;
|
||||||
|
newJob.vehicle_info = item.Job.vehicle.v_model_yr + " " + item.Job.vehicle.v_make_desc + " " + item.Job.vehicle.v_model_desc;
|
||||||
|
newJob.clm_no = item.Job.clm_no;
|
||||||
|
|
||||||
var r = new GraphQLRequest
|
var r = new GraphQLRequest
|
||||||
{
|
{
|
||||||
Query = @"
|
Query = @"
|
||||||
mutation INSERT_JOB($jobInput: [jobs_insert_input!]!) {
|
mutation INSERT_AVAILABLE_JOB($jobInput: [available_jobs_insert_input!]!) {
|
||||||
insert_jobs(objects: $jobInput) {
|
insert_available_jobs(objects: $jobInput) {
|
||||||
returning {
|
returning {
|
||||||
id
|
id
|
||||||
}
|
}
|
||||||
@@ -97,9 +125,10 @@ namespace BodyshopUploader.Utils
|
|||||||
}",
|
}",
|
||||||
Variables = new
|
Variables = new
|
||||||
{
|
{
|
||||||
jobInput = item.Job
|
jobInput = newJob
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var d = await Utils.GraphQL.ExecuteQuery(r);
|
var d = await Utils.GraphQL.ExecuteQuery(r);
|
||||||
|
|||||||
Reference in New Issue
Block a user