Projekt

Obecné

Profil

« Předchozí | Další » 

Revize d2799ca5

Přidáno uživatelem Jakub Danek před více než 5 roky(ů)

re #37 make UI compatible with new User controller API

Zobrazit rozdíly:

webapp/src/app/header/header.component.ts
4 4
import {UserService} from '../services/api/user.service';
5 5
import {UserProfile} from '../models/user.model';
6 6
import {ProfileSettingsComponent} from '../profile-settings/profile-settings.component';
7
import {UsersService} from "../services/api/users.service";
7 8

  
8 9
@Component({
9 10
  selector: 'app-header',
......
17 18
  constructor(
18 19
    private dialog: MatDialog,
19 20
    private localizationService: LocalizationService,
20
    private userService: UserService
21
    private userService: UserService,
22
    private usersService: UsersService
21 23
    ) {
22
    userService.getLoggedUserProfile()
24
    usersService.getLoggedUserProfile()
23 25
      .subscribe((data: UserProfile) => this.profile = data);
24 26
    this.language = this.localizationService.getCurrentLanguage();
25 27
  }
......
28 30
    this.language = this.localizationService.switchLocale(language);
29 31
  }
30 32
  onProfileClick(): void {
31
    this.userService.getLoggedUserProfile()
33
    this.usersService.getLoggedUserProfile()
32 34
      .subscribe((data: UserProfile) => {
33 35
        this.profile = data;
34 36

  
......
47 49
            },
48 50
            this.localizationService.getCurrentLanguage()
49 51
          ).subscribe(() => {
50
            this.userService.getLoggedUserProfile().subscribe((profile: UserProfile) => this.profile = profile);
52
            this.usersService.getLoggedUserProfile().subscribe((profile: UserProfile) => this.profile = profile);
51 53
          });
52 54
        });
53 55
      });

Také k dispozici: Unified diff