From 4fc251e854cef038111ff9dba78dfcc68496b4d7 Mon Sep 17 00:00:00 2001 From: tnsprasanna Date: Thu, 21 Nov 2024 22:12:40 -0500 Subject: [PATCH] call api --- .../src/components/pages/schedule/SchedulePage.tsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/frontend/src/components/pages/schedule/SchedulePage.tsx b/frontend/src/components/pages/schedule/SchedulePage.tsx index 491cc69..22bd7a7 100644 --- a/frontend/src/components/pages/schedule/SchedulePage.tsx +++ b/frontend/src/components/pages/schedule/SchedulePage.tsx @@ -19,11 +19,14 @@ import { CalendarMonth, } from "@mui/icons-material"; +import { useQuery } from "@apollo/client"; + import FullCalendar from "@fullcalendar/react"; import { CalendarApi } from "@fullcalendar/core"; import { ScheduleType } from "../../../types/ScheduleTypes"; import ScheduleListView from "./listView/ScheduleListView"; import ScheduleCalendar from "./calendarView/ScheduleCalendar"; +import { GET_TASKS_BY_ASSIGNEE_ID } from "../../../APIClients/Queries/TaskQueries"; const SchedulePage = (): React.ReactElement => { const [rooms, setRooms] = useState([]); @@ -34,6 +37,17 @@ const SchedulePage = (): React.ReactElement => { const calendarRef = useRef(null); + const { loading, error, data } = useQuery(GET_TASKS_BY_ASSIGNEE_ID, { + variables: { assigneeId: "123" }, + }); + + useEffect(() => { + if (data) { + setScheduleData(JSON.stringify(data.getTasksByAssigneeId, null)); + } + }, [data]); + + const handleNext = () => { console.log(scheduleType); if (scheduleType === "CALENDAR") {