Ignore:
Timestamp:
11/05/20 08:53:48 (4 years ago)
Author:
Mile Jankuloski <mile.jankuloski@…>
Branches:
master
Children:
1db5673
Parents:
afc9a9a
Message:

Auth fixes, bug fixes etc.

Location:
Farmatiko/ClientApp/src/app/dashboard
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Farmatiko/ClientApp/src/app/dashboard/dashboard.component.html

    rafc9a9a rad60966  
    1212        <div class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse">
    1313          <ul class="navbar-nav flex-grow">
    14             <li>Logged as ...<p *ngIf="head">{{head.Name}}</p> </li>
     14            <li>Logged as <p *ngIf="head">{{head.Name}}</p> </li>
     15            <li (click)="logout()" class="btn btn-link"><a>Logout</a></li>
    1516          </ul>
    1617        </div>
  • Farmatiko/ClientApp/src/app/dashboard/dashboard.component.ts

    rafc9a9a rad60966  
    33import { MatSnackBar, MatSnackBarRef, SimpleSnackBar } from '@angular/material/snack-bar';
    44import { IPharmacy, IMedicine, IPharmacyHead, IPharmacyHeadRequest } from '../shared/interfaces';
    5 import { DataService } from '../shared/services/data.service';
     5import { DataService } from '../shared/data.service';
    66import { PharmacyDialogComponent } from '../dialogs/pharmacy-dialog/pharmacy-dialog.component';
    77import { EditPharmacyDialogComponent } from '../dialogs/edit-pharmacy-dialog/edit-pharmacy-dialog.component';
     
    2727
    2828  ngOnInit(): void {
    29     this.authService.getUser().subscribe((data : IPharmacyHead) => {
    30         this.head = data;
    31     });
     29    this.authService.getUser()
     30        .subscribe((data) => {
     31          console.log(data);
     32          this.head = data;
     33        },
     34        (err: any) => console.log(err),
     35        () => console.log('User data retrieved'));
    3236    this.dataService.getPharmacies()
    3337        .subscribe((pharmacy: IPharmacy[]) => {
     
    102106  }
    103107
     108  logout() {
     109    this.authService.logout();
     110  }
     111
    104112  openPharmacyDialog(pharmacy: IPharmacy): void {
    105113    this.dialog.open(PharmacyDialogComponent, {
Note: See TracChangeset for help on using the changeset viewer.