Removed job status table. Added existing appointments timeline to modal. Refetching on calendar on delete.

This commit is contained in:
Patrick Fic
2020-02-06 15:06:13 -08:00
parent fae1e8cdeb
commit 8761dafdff
32 changed files with 1940 additions and 56 deletions

View File

@@ -2,14 +2,22 @@ import React from "react";
import { useMutation } from "react-apollo";
import { CANCEL_APPOINTMENT_BY_ID } from "../../graphql/appointments.queries";
import ScheduleEventComponent from "./schedule-event.component";
import { notification } from "antd";
import { useTranslation } from "react-i18next";
export default function ScheduleEventContainer({ event, refetch }) {
const { t } = useTranslation();
const [cancelAppointment] = useMutation(CANCEL_APPOINTMENT_BY_ID);
console.log("refetch", refetch);
const handleCancel = id => {
cancelAppointment({ variables: { appid: event.id } }).then(r => {
if (refetch) refetch();
});
cancelAppointment({ variables: { appid: event.id } })
.then(r => {
notification["success"]({
message: t("appointments.successes.canceled")
});
if (refetch) refetch();
})
.catch(error => {
notification["error"]({ message: t("appointments.errors.canceling") });
});
};
return <ScheduleEventComponent event={event} handleCancel={handleCancel} />;