Ver código fonte

fix(patient->regitser):Follow-up fix ,from regiser to exam by navigation bar button

dengdx 1 mês atrás
pai
commit
8c21dc06e7
1 arquivos alterados com 5 adições e 9 exclusões
  1. 5 9
      src/domain/patient/registerLogic.ts

+ 5 - 9
src/domain/patient/registerLogic.ts

@@ -1,5 +1,3 @@
-import { useSelector } from 'react-redux';
-import { RootState } from '@/states/store';
 import {
   registerWork,
   RegisterWorkResponseData,
@@ -10,16 +8,14 @@ import registerformSchema from '@/validation/patient/registerSchema';
 import dayjs from 'dayjs';
 import utc from 'dayjs/plugin/utc';
 import { View } from '@/API/patient/viewActions';
+import store from '@/states/store';
 dayjs.extend(utc);
 
 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<{
     success: boolean;