From 1b58461bbea3be818410f9d1aeb59fd1448be8c4 Mon Sep 17 00:00:00 2001
From: Adithya Ajith <4adhi007@gmail.com>
Date: Sat, 3 Dec 2022 19:34:27 +0530
Subject: [PATCH] user api
---
src/Context/Context.js | 6 ++----
src/components/Editprofileform/Editprofileform.js | 14 +++++++++-----
src/pages/Dashboard/Dashboard.js | 1 +
3 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/src/Context/Context.js b/src/Context/Context.js
index cd0e23e..e575be9 100644
--- a/src/Context/Context.js
+++ b/src/Context/Context.js
@@ -5,11 +5,9 @@ const AppContext = React.createContext()
const AppProvider = ({ children }) => {
// const [authenticated,setAuthenticated] = useState(false)
- const[actualname,setActualname]=useState('')
- const[phno,setPhno]=useState('')
- const[userimg,setUserimg]=useState()
+
return {children}
}
diff --git a/src/components/Editprofileform/Editprofileform.js b/src/components/Editprofileform/Editprofileform.js
index ef0723c..ae64aa8 100644
--- a/src/components/Editprofileform/Editprofileform.js
+++ b/src/components/Editprofileform/Editprofileform.js
@@ -2,10 +2,13 @@ import Button from 'react-bootstrap/Button';
import Form from 'react-bootstrap/Form';
import axiosInstance from '../../utils/axios'
import baseUrl from '../../utils/Urls';
+import {useState} from 'react'
-function Editprofileform({actualname,setActualname,phno,setPhno,userimg,setUserimg}) {
+function Editprofileform() {
-
+ const[actualname,setActualname]=useState('')
+ const[phno,setPhno]=useState('')
+ const[userimg,setUserimg]=useState()
@@ -14,8 +17,9 @@ function Editprofileform({actualname,setActualname,phno,setPhno,userimg,setUseri
"actual_name":actualname,
"phno":phno,
- "user_image":userimg
-
+ "user_image":userimg,
+ "user_foreign":localStorage.getItem('userid')
+
})
e.preventDefault();
@@ -49,7 +53,7 @@ function Editprofileform({actualname,setActualname,phno,setPhno,userimg,setUseri
- Phone number
+ Linkedin
{
setCurr_username(response.data.username)
setCurrEmail(response.data.email)
setcurrUserid(response.data.id)
+ localStorage.setItem('userid',response.data.id)
},(error)=>{
console.log(error)
})