From f2947397f4e99911fe0f8b38c1b1a0c2661dd3e2 Mon Sep 17 00:00:00 2001
From: Blaster4385 <venkateshchaturvedi12@gmail.com>
Date: Thu, 18 Aug 2022 20:28:10 +0530
Subject: Switch to context api for enrollment form

---
 client/src/pages/Enrollment/DocumentScanner/DocumentScanner.jsx | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'client/src/pages/Enrollment/DocumentScanner/DocumentScanner.jsx')

diff --git a/client/src/pages/Enrollment/DocumentScanner/DocumentScanner.jsx b/client/src/pages/Enrollment/DocumentScanner/DocumentScanner.jsx
index 043d5b5..f65051e 100644
--- a/client/src/pages/Enrollment/DocumentScanner/DocumentScanner.jsx
+++ b/client/src/pages/Enrollment/DocumentScanner/DocumentScanner.jsx
@@ -14,9 +14,11 @@ import {
 } from '@mui/material'
 import SubmitButton from '../../../components/SubmitButton/SubmitButton'
 import { useTranslation } from 'react-i18next'
+import { userContext } from '../../../context/User'
 
-const DocumentScanner = ({ formData, setFormData }) => {
+const DocumentScanner = () => {
   const { t } = useTranslation()
+  const { userData, setUserData } = userContext()
   const steps = [
     t('PROOF_OF_IDENTITY'),
     t('PROOF_OF_ADDRESS'),
@@ -45,7 +47,7 @@ const DocumentScanner = ({ formData, setFormData }) => {
 
   const handleNext = () => {
     if (activeStep === steps.length - 1) {
-      setFormData({ ...formData, documents: documents })
+      setUserData({ ...userData, documents: documents })
     }
     setActiveStep((prevActiveStep) => prevActiveStep + 1)
   }
-- 
cgit 

