From be2cfb908a5000f0d8a02518a6fcb926e964a896 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Thu, 12 Aug 2021 13:01:20 -0700 Subject: [PATCH 1/3] IO-1312 Resolve delivery checklist issue. --- .../job-checklist-form.component.jsx | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/client/src/components/job-checklist/components/job-checklist-form/job-checklist-form.component.jsx b/client/src/components/job-checklist/components/job-checklist-form/job-checklist-form.component.jsx index cc61d1aa3..7495ec6cc 100644 --- a/client/src/components/job-checklist/components/job-checklist-form/job-checklist-form.component.jsx +++ b/client/src/components/job-checklist/components/job-checklist-form/job-checklist-form.component.jsx @@ -117,21 +117,22 @@ export function JobChecklistForm({ }); } } - - //Updae Owner Allow to Text - const updateOwnerResult = await updateOwner({ - variables: { - ownerId: job.owner.id, - owner: { allow_text_message: values.allow_text_message }, - }, - }); - - if (!!updateOwnerResult.errors) { - notification["error"]({ - message: t("checklist.errors.complete", { - error: JSON.stringify(result.errors), - }), + if (type === "intake" && job.owner && job.owner.id) { + //Updae Owner Allow to Text + const updateOwnerResult = await updateOwner({ + variables: { + ownerId: job.owner.id, + owner: { allow_text_message: values.allow_text_message }, + }, }); + + if (!!updateOwnerResult.errors) { + notification["error"]({ + message: t("checklist.errors.complete", { + error: JSON.stringify(result.errors), + }), + }); + } } setLoading(false); From 8ff2a6e6c4e4a8e4c7a5220f72d3558db1b8bf04 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Thu, 12 Aug 2021 13:16:26 -0700 Subject: [PATCH 2/3] Resolve delete checklist item. --- .../jobs-admin-delete-intake.component.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/components/jobs-admin-delete-intake/jobs-admin-delete-intake.component.jsx b/client/src/components/jobs-admin-delete-intake/jobs-admin-delete-intake.component.jsx index db96f74ef..190778437 100644 --- a/client/src/components/jobs-admin-delete-intake/jobs-admin-delete-intake.component.jsx +++ b/client/src/components/jobs-admin-delete-intake/jobs-admin-delete-intake.component.jsx @@ -22,10 +22,10 @@ export default function JobAdminDeleteIntake({ job }) { mutation DELETE_DELIVERY($jobId: uuid!) { update_jobs_by_pk( pk_columns: { id: $jobId } - _set: { deliverychecklist: null } + _set: { deliverchecklist: null } ) { id - deliverychecklist + deliverchecklist } } `); From ef79ccc299c349760f5cffd77234469eb61a4a36 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Thu, 12 Aug 2021 13:20:56 -0700 Subject: [PATCH 3/3] Additional Checklist resolutions. --- .../job-checklist-form/job-checklist-form.component.jsx | 2 +- client/src/graphql/jobs.queries.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/client/src/components/job-checklist/components/job-checklist-form/job-checklist-form.component.jsx b/client/src/components/job-checklist/components/job-checklist-form/job-checklist-form.component.jsx index 7495ec6cc..cc4794588 100644 --- a/client/src/components/job-checklist/components/job-checklist-form/job-checklist-form.component.jsx +++ b/client/src/components/job-checklist/components/job-checklist-form/job-checklist-form.component.jsx @@ -177,7 +177,7 @@ export function JobChecklistForm({ initialValues={{ ...(type === "intake" && { addToProduction: true, - allow_text_message: job.owner.allow_text_message, + allow_text_message: job.owner && job.owner.allow_text_message, scheduled_completion: (job && job.scheduled_completion) || moment().businessAdd( diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js index aad807da1..e2608f8ab 100644 --- a/client/src/graphql/jobs.queries.js +++ b/client/src/graphql/jobs.queries.js @@ -1849,6 +1849,10 @@ export const QUERY_JOB_CHECKLISTS = gql` scheduled_delivery actual_delivery production_vars + owner { + id + allow_text_message + } bodyshop { id intakechecklist