Table updates for new appointments fields. Schedule modal baseline functionality. Refactor schedule components to be more reusable.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import React from "react";
|
||||
import { useMutation } from "react-apollo";
|
||||
import { CANCEL_APPOINTMENT_BY_ID } from "../../graphql/appointments.queries";
|
||||
import ScheduleEventComponent from "./schedule-event.component";
|
||||
|
||||
export default function ScheduleEventContainer({ event, refetch }) {
|
||||
const [cancelAppointment] = useMutation(CANCEL_APPOINTMENT_BY_ID);
|
||||
console.log("refetch", refetch);
|
||||
const handleCancel = id => {
|
||||
cancelAppointment({ variables: { appid: event.id } }).then(r => {
|
||||
if (refetch) refetch();
|
||||
});
|
||||
};
|
||||
|
||||
return <ScheduleEventComponent event={event} handleCancel={handleCancel} />;
|
||||
}
|
||||
Reference in New Issue
Block a user