Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. ngOnInit() {
  2. this.usuario = localStorage.getItem("user");
  3. this.entityCtrl.getEntityByUser(localStorage.getItem("user")).subscribe(
  4. response => {
  5. this.entidadesTodos = response["body"];
  6. this.entidad = this.entidadesTodos[0]["id"];
  7. localStorage.setItem("entidad", this.entidad.toString());
  8. },
  9.  
  10. (error: any) => {
  11. console.log(error);
  12. }
  13. );
  14.  
  15. this.entityCtrl
  16. .getGroupsByEntityAndUser(
  17. localStorage.getItem("entidad"),
  18. localStorage.getItem("user")
  19. )
  20. .subscribe(
  21. response => {
  22. this.groupsTodos = response["body"];
  23. this.grupo = this.groupsTodos[0]["id"];
  24. localStorage.setItem("grupo", this.grupo.toString());
  25. },
  26. (error: any) => {
  27. console.log(error);
  28. }
  29. );
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement