IO-1711 Cancel appointments from job

This commit is contained in:
Patrick Fic
2022-04-07 15:22:27 -07:00
parent b738fc9007
commit a4c4329253
6 changed files with 80 additions and 0 deletions

View File

@@ -245,6 +245,27 @@ export const CANCEL_APPOINTMENT_BY_ID = gql`
}
`;
export const CANCEL_APPOINTMENTS_BY_JOB_ID = gql`
mutation CANCEL_APPOINTMENTS_BY_JOB_ID($jobid: uuid!, $job: jobs_set_input) {
update_appointments(
where: { _and: { jobid: { _eq: $jobid }, arrived: { _eq: false } } }
_set: { canceled: true }
) {
returning {
id
canceled
}
}
update_jobs_by_pk(pk_columns: { id: $jobid }, _set: $job) {
date_scheduled
id
scheduled_in
scheduled_completion
status
}
}
`;
export const QUERY_APPOINTMENTS_BY_JOBID = gql`
query QUERY_APPOINTMENTS_BY_JOBID($jobid: uuid!) {
appointments(where: { jobid: { _eq: $jobid } }, order_by: { start: desc }) {