Mark job as open upon cancelled appointment IO-678

This commit is contained in:
Patrick Fic
2021-02-23 11:18:39 -08:00
parent a27390e2d3
commit ce8d795b56
3 changed files with 9 additions and 8 deletions

View File

@@ -1,10 +1,9 @@
import { DownOutlined, UpOutlined } from "@ant-design/icons";
import React from "react"; import React from "react";
import { UpOutlined, DownOutlined } from "@ant-design/icons";
export default function FormListMoveArrows({ move, index, total }) { export default function FormListMoveArrows({ move, index, total }) {
const upDisabled = index === 0; const upDisabled = index === 0;
const downDisabled = index === total - 1; const downDisabled = index === total - 1;
console.log(index);
const handleUp = () => { const handleUp = () => {
move(index, index - 1); move(index, index - 1);
}; };

View File

@@ -86,7 +86,7 @@ export function ScheduleCalendarWrapperComponent({
} }
eventPropGetter={handleEventPropStyles} eventPropGetter={handleEventPropStyles}
components={{ components={{
event: (e) => Event({ event: e.event, refetch: refetch }), event: (e) => Event({ bodyshop: bodyshop, event: e.event, refetch: refetch }),
header: HeaderComponent, header: HeaderComponent,
}} }}
{...otherProps} {...otherProps}

View File

@@ -1,13 +1,13 @@
import React from "react";
import { useMutation } from "@apollo/react-hooks"; import { useMutation } from "@apollo/react-hooks";
import { notification } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import { logImEXEvent } from "../../firebase/firebase.utils";
import { CANCEL_APPOINTMENT_BY_ID } from "../../graphql/appointments.queries"; import { CANCEL_APPOINTMENT_BY_ID } from "../../graphql/appointments.queries";
import { UPDATE_JOB } from "../../graphql/jobs.queries"; import { UPDATE_JOB } from "../../graphql/jobs.queries";
import ScheduleEventComponent from "./schedule-event.component"; import ScheduleEventComponent from "./schedule-event.component";
import { notification } from "antd";
import { useTranslation } from "react-i18next";
import { logImEXEvent } from "../../firebase/firebase.utils";
export default function ScheduleEventContainer({ event, refetch }) { export default function ScheduleEventContainer({ bodyshop, event, refetch }) {
const { t } = useTranslation(); const { t } = useTranslation();
const [cancelAppointment] = useMutation(CANCEL_APPOINTMENT_BY_ID); const [cancelAppointment] = useMutation(CANCEL_APPOINTMENT_BY_ID);
const [updateJob] = useMutation(UPDATE_JOB); const [updateJob] = useMutation(UPDATE_JOB);
@@ -33,9 +33,11 @@ export default function ScheduleEventContainer({ event, refetch }) {
const jobUpdate = await updateJob({ const jobUpdate = await updateJob({
variables: { variables: {
jobId: event.job.id, jobId: event.job.id,
job: { job: {
date_scheduled: null, date_scheduled: null,
scheduled_in: null, scheduled_in: null,
status: bodyshop.md_ro_statuses.default_imported,
}, },
}, },
}); });