Changeset d66b8eb for phonelux-frontend/src/context
- Timestamp:
- 09/21/22 18:47:39 (2 years ago)
- Branches:
- master
- Children:
- 34950c6
- Parents:
- 5201690
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
phonelux-frontend/src/context/UserContext.js
r5201690 rd66b8eb 12 12 userId: '', 13 13 name: '', 14 role: '', 15 userFavouriteOffers: [] 14 role: '' 16 15 } 17 16 } … … 28 27 name: firstName, 29 28 role: userRole 30 } , this.updateUserFavouriteOffers)29 }) 31 30 }).catch(error => console.log(error)) 32 31 } 33 32 } 34 35 // updateUserFavouriteOffers = () =>{ 36 // var config = { 37 // method: 'get', 38 // url: '/user/'+this.state.userId+'/favouriteoffers', 39 // headers: { 40 // 'Authorization': 'Bearer '+localStorage.getItem('token') 41 // } 42 // }; 43 44 // axios(config) 45 // .then(response => { 46 // this.setState({ 47 // userFavouriteOffers: response.data 48 // }) 49 // }) 50 // .catch(error => { 51 // console.log(error) 52 // }) 53 // } 54 55 33 56 34 57 35 render() { 58 const {userId,name,role, userFavouriteOffers} = this.state 59 // const {updateUserFavouriteOffers} = this 36 const {userId,name,role} = this.state 60 37 return ( 61 38 <UserContext.Provider value={{ 62 39 userId, 63 40 name, 64 role, 65 // userFavouriteOffers, 66 // updateUserFavouriteOffers 41 role 67 42 }}> 68 43 {this.props.children}
Note:
See TracChangeset
for help on using the changeset viewer.