Skip to content

Commit

Permalink
call api
Browse files Browse the repository at this point in the history
  • Loading branch information
tnsprasanna committed Nov 22, 2024
1 parent cdb5166 commit 4fc251e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions frontend/src/components/pages/schedule/SchedulePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<number[]>([]);
Expand All @@ -34,6 +37,17 @@ const SchedulePage = (): React.ReactElement => {

const calendarRef = useRef<CalendarApi | null>(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") {
Expand Down

0 comments on commit 4fc251e

Please sign in to comment.