The user Profile component will fetch the list of just the games made by the given user with the list by the maker API. We will update the init method in the Profile component to call the listByMaker fetch method after the user details are retrieved.
mern-vrgame/client/user/Profile.js:
init = (userId) => { const jwt = auth.isAuthenticated() read({ userId: userId }, {t: jwt.token}).then((data) => { if (data.error) { this.setState({redirectToSignin: true}) } else { this.setState({user: data}) listByMaker({userId: data._id}).then((data) => { if (data.error) { console.log(data.error) } else { this.setState({games: data}) } }) } }) }
Similar to how the game list is rendered in the Home component, we will set the list of ...