Created
January 4, 2020 06:00
-
-
Save Hemant27031999/bb6acf0b9a460d3e01740571e6f4f093 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loadChattingUser = (loadingData) => { | |
this.setState({ 'msgingChat': [] }); | |
this.setState({friend: { | |
'name': loadingData.name, | |
'imageURL': loadingData.imageurl, | |
'email':loadingData.email, | |
'msgDatabase': loadingData.msgdata | |
}}) | |
var database=loadingData.msgdata; | |
fetch('https://agile-headland-13060.herokuapp.com/msges',{ | |
method: 'post', | |
headers: {'Content-Type':'application/json'}, | |
body:JSON.stringify({ | |
database: database | |
}) | |
}) | |
.then(response => response.json()) | |
.then(data => { | |
if(data.length !== 0){ | |
this.setState({ | |
msgingChat: data, | |
branch: 'chat' | |
}); | |
} | |
}) | |
this.setState({ 'branch': 'chat' }); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment