From 279e93f0c3bac051fbb981b9b3a906e3fbd9c61b Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 14 Mar 2022 13:46:18 -0700 Subject: [PATCH] IO-1774 Cancel appointments when voiding. --- .../jobs-detail-header-actions.component.jsx | 2 ++ client/src/graphql/jobs.queries.js | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.component.jsx b/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.component.jsx index 015e0113c..5a9715a96 100644 --- a/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.component.jsx +++ b/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.component.jsx @@ -401,6 +401,8 @@ export function JobsDetailHeaderActions({ job: { status: bodyshop.md_ro_statuses.default_void, voided: true, + scheduled_in: null, + inproduction: false, }, note: [ { diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js index 0fcc56a0f..9f4c1664c 100644 --- a/client/src/graphql/jobs.queries.js +++ b/client/src/graphql/jobs.queries.js @@ -651,7 +651,7 @@ export const GET_JOB_BY_PK = gql` date_last_contacted date_next_contact date_towin - date_rentalresp + date_rentalresp date_exported status owner_owing @@ -1100,6 +1100,15 @@ export const VOID_JOB = gql` insert_notes(objects: $note) { affected_rows } + update_appointments( + where: { jobid: { _eq: $jobId } } + _set: { canceled: true } + ) { + returning { + id + canceled + } + } } `;