summaryrefslogtreecommitdiff
path: root/client/src
diff options
context:
space:
mode:
Diffstat (limited to 'client/src')
-rw-r--r--client/src/context/User.js52
-rw-r--r--client/src/pages/Enrollment/Enrollment.jsx4
2 files changed, 52 insertions, 4 deletions
diff --git a/client/src/context/User.js b/client/src/context/User.js
index b3b42e5..a3a883e 100644
--- a/client/src/context/User.js
+++ b/client/src/context/User.js
@@ -4,8 +4,56 @@ export const UserContext = createContext()
export const Context = ({ children }) => {
const [aadhaarNumber, setAadhaarNumber] = useState(null)
- const [userData, setUserData] = useState({})
- const [oriUserData, setOriUserData] = useState({})
+ const [userData, setUserData] = useState({
+ indianResident: '',
+ name: '',
+ gender: '',
+ dob: new Date().toISOString().slice(0, 10),
+ mobile: '',
+ email: '',
+ address: {
+ houseNo: '',
+ street: '',
+ locality: '',
+ landmark: '',
+ village: '',
+ district: {},
+ state: {},
+ postOffice: '',
+ pincode: ''
+ },
+ photo: '',
+ documents: {
+ POI: '',
+ POA: '',
+ DOB: ''
+ }
+ })
+ const [oriUserData, setOriUserData] = useState({
+ indianResident: '',
+ name: '',
+ gender: '',
+ dob: new Date().toISOString().slice(0, 10),
+ mobile: '',
+ email: '',
+ address: {
+ houseNo: '',
+ street: '',
+ locality: '',
+ landmark: '',
+ village: '',
+ district: {},
+ state: {},
+ postOffice: '',
+ pincode: ''
+ },
+ photo: '',
+ documents: {
+ POI: '',
+ POA: '',
+ DOB: ''
+ }
+ })
const initialUser = {
aadhaarNumber,
diff --git a/client/src/pages/Enrollment/Enrollment.jsx b/client/src/pages/Enrollment/Enrollment.jsx
index cda04df..59211f9 100644
--- a/client/src/pages/Enrollment/Enrollment.jsx
+++ b/client/src/pages/Enrollment/Enrollment.jsx
@@ -58,9 +58,9 @@ const Enrollment = () => {
setPage(page + 1)
}
} else if (page === 2) {
- if (userData.address.state.name === '') {
+ if (!userData.address.state.name) {
toast.error(t('PLEASE_SELECT_YOUR_STATE'))
- } else if (userData.address.district.name === '') {
+ } else if (!userData.address.district.name) {
toast.error(t('PLEASE_SELECT_YOUR_DISTRICT'))
} else if (userData.address.village === '') {
toast.error(t('PLEASE_ENTER_YOUR_VILLAGE'))