Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getUserData() {
- var xhttp = new XMLHttpRequest();
- xhttp.onreadystatechange = function () {
- if (this.readyState == 4 && this.status == 200) {
- accountDetails = JSON.parse(this.responseText);
- loadSubscriptions();
- (<any>document.getElementById("avatarimg")).setAttribute("src","./avatar/"+ accountDetails.avatarId +".svg");
- console.log(accountDetails);
- }
- };
- fetch('http://localhost:8080/api/users/current')
- .then(function (response) {
- return response.json();
- })
- .then(function (user) {
- xhttp.open("GET", "http://localhost:8080/api/users/" + user.id, true);
- xhttp.send();
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement