Skip to content

Commit

Permalink
user api
Browse files Browse the repository at this point in the history
  • Loading branch information
XdithyX committed Dec 3, 2022
1 parent b5de6c8 commit 1b58461
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
6 changes: 2 additions & 4 deletions src/Context/Context.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 <AppContext.Provider value={{
actualname,setActualname,phno,setPhno,userimg,setUserimg


}}>{children}</AppContext.Provider>
}
Expand Down
14 changes: 9 additions & 5 deletions src/components/Editprofileform/Editprofileform.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()



Expand All @@ -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();
Expand Down Expand Up @@ -49,7 +53,7 @@ function Editprofileform({actualname,setActualname,phno,setPhno,userimg,setUseri
</Form.Group><br/>

<Form.Group>
<h5>Phone number</h5>
<h5>Linkedin</h5>
<Form.Control
type="text"
placeholder="phone number"
Expand Down
1 change: 1 addition & 0 deletions src/pages/Dashboard/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const Dashboard = () => {
setCurr_username(response.data.username)
setCurrEmail(response.data.email)
setcurrUserid(response.data.id)
localStorage.setItem('userid',response.data.id)
},(error)=>{
console.log(error)
})
Expand Down

0 comments on commit 1b58461

Please sign in to comment.