Guest User

Untitled

a guest
Dec 10th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. public update(idtoken: string, name: string, picture: string):any {
  2. var body = { idtoken : idtoken, type: 'update', name: name, picture: picture };
  3. return this.http.post(global.url + '/api/user', body, {}).map(result =>
  4. {
  5. console.log(result);
  6. });
  7. }
  8.  
  9. dialogRef.afterClosed().subscribe(result => {
  10. if(!isNullOrUndefined(result)) {
  11. if (!isNullOrUndefined(result.name)) {
  12. this.name = result.name;
  13. }
  14. if (!isNullOrUndefined(result.image)) {
  15. this.profileImage = result.image;
  16. }
  17. this.userService.update(this.id_token,this.name, this.profileImage).subscribe(result => console.log(result));
  18. }
  19. });
Add Comment
Please, Sign In to add comment