|
@@ -1,5 +1,3 @@
|
|
-import { useSelector } from 'react-redux';
|
|
|
|
-import { RootState } from '@/states/store';
|
|
|
|
import {
|
|
import {
|
|
registerWork,
|
|
registerWork,
|
|
RegisterWorkResponseData,
|
|
RegisterWorkResponseData,
|
|
@@ -10,16 +8,14 @@ import registerformSchema from '@/validation/patient/registerSchema';
|
|
import dayjs from 'dayjs';
|
|
import dayjs from 'dayjs';
|
|
import utc from 'dayjs/plugin/utc';
|
|
import utc from 'dayjs/plugin/utc';
|
|
import { View } from '@/API/patient/viewActions';
|
|
import { View } from '@/API/patient/viewActions';
|
|
|
|
+import store from '@/states/store';
|
|
dayjs.extend(utc);
|
|
dayjs.extend(utc);
|
|
|
|
|
|
const useRegisterLogic = () => {
|
|
const useRegisterLogic = () => {
|
|
- const formData = useSelector((state: RootState) => state.form.formData);
|
|
|
|
- const selectedViews = useSelector(
|
|
|
|
- (state: RootState) => state.viewSelection.selectedViews
|
|
|
|
- );
|
|
|
|
- const currentPatientType = useSelector(
|
|
|
|
- (state: RootState) => state.patientType.current
|
|
|
|
- );
|
|
|
|
|
|
+ const rootState=store.getState();
|
|
|
|
+ const formData = rootState.form.formData;
|
|
|
|
+ const selectedViews = rootState.viewSelection.selectedViews;
|
|
|
|
+ const currentPatientType = rootState.patientType.current;
|
|
|
|
|
|
const handleRegister = async (): Promise<{
|
|
const handleRegister = async (): Promise<{
|
|
success: boolean;
|
|
success: boolean;
|