summaryrefslogtreecommitdiff
path: root/client/src/pages/Update/Demographic/Demographic.jsx
diff options
context:
space:
mode:
authorRohan Raj Gupta <[email protected]>2022-08-18 19:27:42 +0530
committerGitHub <[email protected]>2022-08-18 19:27:42 +0530
commit6c924aef55707885cbbf9af8348564526ac146ee (patch)
treef837dcd278a6d6de9adf123b827b2e8b35835221 /client/src/pages/Update/Demographic/Demographic.jsx
parent6b85ebee8986b982e05d49c8f1a326deb3e08bae (diff)
parentd391caf122fcdf7ff4a9e227748b9a10242b15d6 (diff)
Merge pull request #7 from rohan09-raj/fix2
Added modal and audio assets, and Completed update flow
Diffstat (limited to 'client/src/pages/Update/Demographic/Demographic.jsx')
-rw-r--r--client/src/pages/Update/Demographic/Demographic.jsx26
1 files changed, 1 insertions, 25 deletions
diff --git a/client/src/pages/Update/Demographic/Demographic.jsx b/client/src/pages/Update/Demographic/Demographic.jsx
index 7638f39..61fe972 100644
--- a/client/src/pages/Update/Demographic/Demographic.jsx
+++ b/client/src/pages/Update/Demographic/Demographic.jsx
@@ -1,6 +1,4 @@
import React, { useState } from 'react'
-import { useQuery } from 'react-query'
-import { getUserByAadhaar } from '../../../services/apiservice'
import Address from '../Address/Address'
import DocumentScanner from '../DocumentScanner/DocumentScanner'
import SubmitButton from '../../../components/SubmitButton/SubmitButton'
@@ -19,32 +17,10 @@ import 'react-toastify/dist/ReactToastify.css'
const Demographic = () => {
const { t } = useTranslation()
- const { aadhaarNumber, userData, setUserData } = userContext()
+ const { userData } = userContext()
const [page, setPage] = useState(0)
- const isLongEnough = aadhaarNumber?.toString().length > 11
-
- // Make api call using the provided aadhaar number and set the user data in the context if the api call is successful. Set form data to the user data if the api call is successful and prevent too many re-renders.
- const { isLoading, isError, data } = useQuery('user', async () => {
- if (isLongEnough) {
- const response = await getUserByAadhaar(aadhaarNumber)
- return response
- }
- })
-
- if (isLoading) {
- return <div>{t('loading')}</div>
- }
-
- if (isError) {
- return <div>{t('error')}</div>
- }
-
- if (data) {
- setUserData(data?.data)
- }
-
const handleSubmit = () => {
if (page === 0) {
if (userData.name === '' || userData.name.length < 1) {