Quellcode durchsuchen

feat(exam->exit exam): send leave information with study id to service when user selects Complete in feedback box for half exposed state during exit

sw vor 1 Monat
Ursprung
Commit
a497b82582
1 geänderte Dateien mit 10 neuen und 1 gelöschten Zeilen
  1. 10 1
      src/states/businessFlowMiddlewareLogic.ts

+ 10 - 1
src/states/businessFlowMiddlewareLogic.ts

@@ -79,7 +79,16 @@ const businessFlowMiddlewareLogic: Middleware =
       console.log(
         `[businessFlowMiddleware] Notifying backend for ${action.payload}`
       );
-      // todo 把所有未曝光的体位从study删除掉--服务端和slice。
+      // 通知服务端。
+      const studyId =
+        (store.getState() as RootState)?.bodyPositionList?.selectedBodyPosition
+          ?.work?.StudyID ?? '';
+      if (!studyId) {
+        console.error(
+          '[businessFlowMiddleware] No study ID found for the selected body position.'
+        );
+      }
+      await suspendOrCompleteStudy(studyId, 'Completed');
       return next({ ...action, payload: continueBusinessFlow });
     }
     if (action.payload === 'exitExamSuspended') {