Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const reqBody = { bio: this.state.infoContent };
- const cfg = { headers: { 'Accept': 'application/json','Content-Type': 'application/json', 'Authorization': this.store.user.token } };
- axios.post(endpoint.users+'/profilesetdata', reqBody, cfg)
- .then((result) => {
- //...
- })
- .catch((err) => {
- //...
- })
- // the condition is the difference
- if ( type == 'bio' ){
- const reqBody = { bio: this.state.infoContent };
- }else{
- const reqBody = { bio: this.state.infoContent };
- }
- const cfg = { headers: { 'Accept': 'application/json','Content-Type': 'application/json', 'Authorization': this.store.user.token } };
- axios.post(endpoint.users+'/profilesetdata', reqBody, cfg)
- .then((result) => {
- //...
- })
- .catch((err) => {
- //...
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement