From 90ea2cd699c469cfebf692ac22099d628b62d8d2 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Mon, 17 Jul 2023 09:56:21 -0700 Subject: [PATCH] IO-2170 Correct for Shift clock so Job Status is only on Job Clock --- .../tech-job-clock-out-button.component.jsx | 79 ++++++++++--------- 1 file changed, 41 insertions(+), 38 deletions(-) diff --git a/client/src/components/tech-job-clock-out-button/tech-job-clock-out-button.component.jsx b/client/src/components/tech-job-clock-out-button/tech-job-clock-out-button.component.jsx index 6fb221e7d..d1c5c3528 100644 --- a/client/src/components/tech-job-clock-out-button/tech-job-clock-out-button.component.jsx +++ b/client/src/components/tech-job-clock-out-button/tech-job-clock-out-button.component.jsx @@ -101,24 +101,25 @@ export function TechClockOffButton({ message: t("timetickets.successes.clockedout"), }); } + if (!isShiftTicket) { + const job_update_result = await updateJobStatus({ + variables: { + jobId: jobId, + status: status, + }, + }); - const job_update_result = await updateJobStatus({ - variables: { - jobId: jobId, - status: status, - }, - }); - - if (!!job_update_result.errors) { - notification["error"]({ - message: t("jobs.errors.updating", { - message: JSON.stringify(result.errors), - }), - }); - } else { - notification["success"]({ - message: t("jobs.successes.updated"), - }); + if (!!job_update_result.errors) { + notification["error"]({ + message: t("jobs.errors.updating", { + message: JSON.stringify(result.errors), + }), + }); + } else { + notification["success"]({ + message: t("jobs.successes.updated"), + }); + } } setLoading(false); if (completedCallback) completedCallback(); @@ -217,7 +218,6 @@ export function TechClockOffButton({ ) : null} - - - - - + {isShiftTicket ? ( +
+ ) : ( + + + + )}