diff --git a/web-app/src/Components/Dummies/AppointmentFormModal/useAppointmentFormModal.js b/web-app/src/Components/Dummies/AppointmentFormModal/useAppointmentFormModal.js index 8e758c9..b900aac 100644 --- a/web-app/src/Components/Dummies/AppointmentFormModal/useAppointmentFormModal.js +++ b/web-app/src/Components/Dummies/AppointmentFormModal/useAppointmentFormModal.js @@ -1,4 +1,4 @@ -import {useGetPatientsQuery} from "../../../Api/patientsApi.js"; +import {useGetAllPatientsQuery, useGetPatientsQuery} from "../../../Api/patientsApi.js"; import {useGetAppointmentTypesQuery} from "../../../Api/appointmentTypesApi.js"; import { useCreateAppointmentMutation, @@ -11,7 +11,7 @@ const useAppointmentFormModal = () => { data: patients = [], isLoading: isLoadingPatients, isError: isErrorPatients, - } = useGetPatientsQuery(undefined); + } = useGetAllPatientsQuery(undefined); const { data: appointmentTypes = [], isLoading: isLoadingAppointmentTypes, diff --git a/web-app/src/Components/Pages/AppointmentsPage/Components/AppointmentCalendarTab/useAppointmentCalendar.js b/web-app/src/Components/Pages/AppointmentsPage/Components/AppointmentCalendarTab/useAppointmentCalendar.js deleted file mode 100644 index b840c95..0000000 --- a/web-app/src/Components/Pages/AppointmentsPage/Components/AppointmentCalendarTab/useAppointmentCalendar.js +++ /dev/null @@ -1,13 +0,0 @@ -import {useCreateAppointmentMutation, useUpdateAppointmentMutation} from "../../../../../Api/appointmentsApi.js"; -import { - useCreateScheduledAppointmentMutation, - useUpdateScheduledAppointmentMutation -} from "../../../../../Api/scheduledAppointmentsApi.js"; - - -const useAppointmentCalendar = () => { - const [createAppointment] = useCreateAppointmentMutation(); - const [updateAppointment] = useUpdateAppointmentMutation(); - const [createScheduledAppointment] = useCreateScheduledAppointmentMutation(); - const [updateScheduledAppointment] = useUpdateScheduledAppointmentMutation(); -}; \ No newline at end of file diff --git a/web-app/src/Components/Pages/AppointmentsPage/useAppointments.js b/web-app/src/Components/Pages/AppointmentsPage/useAppointments.js index ad3baa1..87bb150 100644 --- a/web-app/src/Components/Pages/AppointmentsPage/useAppointments.js +++ b/web-app/src/Components/Pages/AppointmentsPage/useAppointments.js @@ -1,6 +1,6 @@ import {useGetAppointmentsQuery} from "../../../Api/appointmentsApi.js"; import {useGetScheduledAppointmentsQuery} from "../../../Api/scheduledAppointmentsApi.js"; -import {useGetPatientsQuery} from "../../../Api/patientsApi.js"; +import {useGetAllPatientsQuery} from "../../../Api/patientsApi.js"; import {notification} from "antd"; import {useEffect} from "react"; import {useSelector} from "react-redux"; @@ -30,7 +30,7 @@ const useAppointments = () => { data: patients = [], isLoading: isLoadingPatients, isError: isErrorPatients, - } = useGetPatientsQuery(undefined, { + } = useGetAllPatientsQuery(undefined, { pollingInterval: 20000, }); diff --git a/web-app/src/Components/Pages/HomePage/useHomePage.js b/web-app/src/Components/Pages/HomePage/useHomePage.js index 5e1a534..72d2d75 100644 --- a/web-app/src/Components/Pages/HomePage/useHomePage.js +++ b/web-app/src/Components/Pages/HomePage/useHomePage.js @@ -1,6 +1,6 @@ import {useGetAppointmentsQuery} from "../../../Api/appointmentsApi.js"; import {useGetScheduledAppointmentsQuery} from "../../../Api/scheduledAppointmentsApi.js"; -import {useGetPatientsQuery} from "../../../Api/patientsApi.js"; +import {useGetAllPatientsQuery} from "../../../Api/patientsApi.js"; import {notification} from "antd"; import {useEffect} from "react"; import {useDispatch, useSelector} from "react-redux"; @@ -15,9 +15,9 @@ import { } from "../../../Redux/Slices/patientsSlice.js"; import dayjs from "dayjs"; import isBetween from "dayjs/plugin/isBetween"; -import {useGetAppointmentTypesQuery} from "../../../Api/appointmentTypesApi.js"; // Import isBetween plugin +import {useGetAppointmentTypesQuery} from "../../../Api/appointmentTypesApi.js"; -dayjs.extend(isBetween); // Extend dayjs with isBetween +dayjs.extend(isBetween); const useHomePage = () => { const dispatch = useDispatch(); @@ -46,7 +46,7 @@ const useHomePage = () => { data: patients = [], isLoading: isLoadingPatients, isError: isErrorPatients, - } = useGetPatientsQuery(undefined, { + } = useGetAllPatientsQuery(undefined, { pollingInterval: 20000, });