IO-1055 Blocked Day improvements.

This commit is contained in:
Patrick Fic
2021-05-10 15:55:33 -07:00
parent 5a40ce21ca
commit ef4d6de1fe
5 changed files with 56 additions and 24 deletions

View File

@@ -30,26 +30,27 @@ export default function ScheduleEventContainer({ bodyshop, event, refetch }) {
return;
}
const jobUpdate = await updateJob({
variables: {
jobId: event.job.id,
if (event.job) {
const jobUpdate = await updateJob({
variables: {
jobId: event.job.id,
job: {
date_scheduled: null,
scheduled_in: null,
status: bodyshop.md_ro_statuses.default_imported,
job: {
date_scheduled: null,
scheduled_in: null,
status: bodyshop.md_ro_statuses.default_imported,
},
},
},
});
if (!!jobUpdate.errors) {
notification["error"]({
message: t("jobs.errors.updating", {
message: JSON.stringify(jobUpdate.errors),
}),
});
return;
if (!!jobUpdate.errors) {
notification["error"]({
message: t("jobs.errors.updating", {
message: JSON.stringify(jobUpdate.errors),
}),
});
return;
}
}
if (refetch) refetch();
};