@@ -98,6 +106,7 @@ export default function Login() {
{/* Forget your password? */}
diff --git a/src/components/index.ts b/src/components/index.ts
index 5ed0e38..9a501f3 100644
--- a/src/components/index.ts
+++ b/src/components/index.ts
@@ -3,9 +3,6 @@ export * from "./Home";
export * from "./GetStarted";
export * from "./shared";
export * from "./Footer";
-// export * from "./DashboardLayout";
export * from "./Icons";
-export * from "./Dashboard";
export * from "./Cards";
-export * from "./LetsGetStated";
export * from "./TsAndCs";
diff --git a/src/core/apiRequest.ts b/src/core/apiRequest.ts
index ce5555b..6ba6260 100644
--- a/src/core/apiRequest.ts
+++ b/src/core/apiRequest.ts
@@ -1,51 +1,18 @@
import { postAuxEnd, getAuxEnd } from "./axiosCall";
// FUNCTION TO START BVN VALIDATION
-export const validateBVN = (postData:any) => {
- let reqData = {
- ...postData
- }
- return postAuxEnd('/bvn', reqData)
-}
+// export const validateBVN = (postData:any) => {
+// let reqData = {
+// ...postData
+// }
+// return postAuxEnd('/bvn', reqData)
+// }
// FUNCTION TO VERIFY OTP AND LOGIN
-export const verifyOTP = (postData:any) => {
- let reqData = {
- ...postData
- }
- return postAuxEnd('/bvn/verify', reqData)
-}
-
-// FUNCTION TO APPLY FOR LOAN
-export const applyForLoan = (postData:any) => {
- let reqData = {
- customer_uid: localStorage.getItem('uid'),
- ...postData
- }
- return postAuxEnd('/loan/apply', reqData)
-}
-
-// FUNCTION TO GET USER BY CUSTOMER UID
-export const getUserByID = (uid:string) => {
- let reqData = {
- // customer_uid: localStorage.getItem('uid'),
- }
- return getAuxEnd(`/profile?uid=${uid}`, reqData)
-}
-
-// FUNCTION TO GET USER BY CUSTOMER UID
-export const getUserPendingLoanList = (uid:string) => {
- let reqData = {
- // customer_uid: localStorage.getItem('uid'),
- }
- return getAuxEnd(`/dash?uid=${uid}`, reqData)
-}
-
-// FUNCTION TO GET LIST OF EMPLOYERS
-export const getEmployersList = () => {
- let reqData = {
- // customer_uid: localStorage.getItem('uid'),
- }
- return getAuxEnd(`/employers`, reqData)
-}
\ No newline at end of file
+// export const verifyOTP = (postData:any) => {
+// let reqData = {
+// ...postData
+// }
+// return postAuxEnd('/bvn/verify', reqData)
+// }
\ No newline at end of file
diff --git a/src/layouts/DashboardLayout/DashboardAuth.tsx b/src/layouts/DashboardLayout/DashboardAuth.tsx
index 40641b0..950214e 100644
--- a/src/layouts/DashboardLayout/DashboardAuth.tsx
+++ b/src/layouts/DashboardLayout/DashboardAuth.tsx
@@ -1,11 +1,11 @@
import {useState, useEffect} from 'react'
-import DashboardLayout from "./DashboardLayout";
+import Layout from '../Layout';
+// import DashboardLayout from "./DashboardLayout";
import { Outlet, useNavigate } from "react-router-dom";
import { useSelector, useDispatch } from "react-redux";
-// import { RouteHandler } from '../../router/routes';
import { updateUserDetails } from '../../store/UserDetails';
-import { getUserByID } from '../../core/apiRequest';
+import { RouteHandler } from '../../router/routes';
import Logo from '../../assets/images/logo.png'
@@ -19,25 +19,35 @@ export default function DashboardAuth() {
const [loading, setLoading] = useState(true)
useEffect(()=>{
+ // let token = localStorage.getItem('token')
+ // let uid = localStorage.getItem('uid')
+ // if(!token || !uid){ // IF NO TOKEN || UID RETURN TO LOGIN PAGE
+ // navigate(RouteHandler.homepage, {replace:true})
+ // return
+ // }
+ // const getUser = () => { // FUNCTION TO GET USER BY ID
+ // getUserByID(uid).then(res=>{
+ // if(!res.data.call_return || !Object.keys(res.data.customer).length){
+ // navigate('', {replace:true})
+ // return
+ // }
+ // setLoading(false)
+ // dispatch(updateUserDetails(res.data.customer));
+ // }).catch(err=>{
+ // navigate('', {replace:true})
+ // console.log('USER ERROR', err)
+ // })
+ // }
+
let token = localStorage.getItem('token')
- let uid = localStorage.getItem('uid')
- if(!token || !uid){
- navigate('', {replace:true})
+ if(!token){ // IF NO TOKEN || UID RETURN TO LOGIN PAGE
+ navigate(RouteHandler.loginpage, {replace:true})
return
}
const getUser = () => { // FUNCTION TO GET USER BY ID
- // let data = {firstname:'firstname', lastname:'lastname', uid:'28273737646466464'}
- getUserByID(uid).then(res=>{
- if(!res.data.call_return || !Object.keys(res.data.customer).length){
- navigate('', {replace:true})
- return
- }
- setLoading(false)
- dispatch(updateUserDetails(res.data.customer));
- }).catch(err=>{
- navigate('', {replace:true})
- console.log('USER ERROR', err)
- })
+ let data = {firstname:'firstname', lastname:'lastname', uid:'28273737646466464'}
+ setLoading(false)
+ dispatch(updateUserDetails(data));
}
if(!Object.keys(userDetails).length){
getUser()
@@ -52,9 +62,9 @@ export default function DashboardAuth() {
loading...
:
-