Removed job status table. Added existing appointments timeline to modal. Refetching on calendar on delete.
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
import React, { useState } from "react";
|
||||
import ScheduleJobModalComponent from "./schedule-job-modal.component";
|
||||
import { useMutation } from "react-apollo";
|
||||
import { INSERT_APPOINTMENT } from "../../graphql/appointments.queries";
|
||||
import { useMutation, useQuery } from "react-apollo";
|
||||
import {
|
||||
INSERT_APPOINTMENT,
|
||||
QUERY_APPOINTMENTS_BY_JOBID
|
||||
} from "../../graphql/appointments.queries";
|
||||
import moment from "moment";
|
||||
import { notification } from "antd";
|
||||
import { useTranslation } from "react-i18next";
|
||||
@@ -9,6 +12,10 @@ export default function ScheduleJobModalContainer({
|
||||
scheduleModalState,
|
||||
jobId
|
||||
}) {
|
||||
const existingAppointments = useQuery(QUERY_APPOINTMENTS_BY_JOBID, {
|
||||
variables: { jobid: jobId },
|
||||
fetchPolicy: "network-only"
|
||||
});
|
||||
const [scheduleModalVisible, setscheduleModalVisible] = scheduleModalState;
|
||||
const [appData, setAppData] = useState({ jobid: jobId, start: null });
|
||||
const [insertAppointment] = useMutation(INSERT_APPOINTMENT);
|
||||
@@ -17,6 +24,7 @@ export default function ScheduleJobModalContainer({
|
||||
|
||||
return (
|
||||
<ScheduleJobModalComponent
|
||||
existingAppointments={existingAppointments}
|
||||
appData={appData}
|
||||
setAppData={setAppData}
|
||||
formData={formData}
|
||||
|
||||
Reference in New Issue
Block a user