Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Component {
- follow = () => {
- this.setState({ makingRequest: true });
- axios.post(this.state.followUrl, {
- follower: this.state.loginUser.id,
- followee: this.state.user.id,
- _token: this.state.token,
- })
- .then(response => {
- const followees = this.state.followees;
- followees.push(response.data.followee);
- this.setState({
- followees: followees,
- makingRequest: false,
- });
- })
- .catch(error => console.log('error', error));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement