Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. // Update User
  2. UpdateUser(user: User){
  3. this.userRef.update({
  4. firstName: user.firstName,
  5. lastName: user.lastName,
  6. displayName: user.displayName,
  7. photoURL: user.photoURL,
  8. emailVerified: user.emailVerified,
  9. birthday: user.birthday,
  10. addressOne: user.addressOne,
  11. addressTwo: user.addressTwo,
  12. zipCode: user.zipCode,
  13. city: user.city,
  14. country: user.country,
  15. phoneOne: user.phoneOne,
  16. phoneTwo: user.phoneTwo,
  17. profilType: user.profilType,
  18. profilPicture: user.profilPicture,
  19. admin: user.admin,
  20. moderator: user.admin
  21. })
  22. }
  23.  
  24. updateUserData(){
  25. this.edituserprofileForm = this.fb.group({
  26. firstName: ['', [Validators, Validators.minLength(2)]],
  27. lastName: ['', [Validators, Validators.minLength(2)]],
  28. address: [],
  29. address2: [],
  30. city: [],
  31. country: [],
  32. zipCode: ['', [Validators.pattern('^[0-9]+$')]],
  33. phoneOne: ['', [Validators.pattern('^[0-9]+$')]]
  34. })
  35. }
  36.  
  37. goBack(){
  38. this.location.back();
  39. }
  40.  
  41. UserUpdateForm(){
  42. this.crudApi.UpdateUser(this.edituserprofileForm.value) // Update user data using CRUD API
  43. console.log(this.edituserprofileForm.value);
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement