Removed job status table. Added existing appointments timeline to modal. Refetching on calendar on delete.
This commit is contained in:
@@ -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} />;
|
||||
|
||||
Reference in New Issue
Block a user