Ignore:
Timestamp:
10/30/20 02:04:06 (4 years ago)
Author:
Mile Jankuloski <mile.jankuloski@…>
Branches:
master
Children:
1f4846d
Parents:
6f203af
Message:

Auth guards and services, refactored components

File:
1 edited

Legend:

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

    r6f203af r993189e  
    88import { MedicineDialogComponent } from '../dialogs/medicine-dialog/medicine-dialog.component';
    99import { ActivatedRoute, Router } from '@angular/router';
     10import { AuthService } from '../shared/auth.service';
    1011
    1112@Component({
     
    2021  public filteredMedicines: IMedicine[] = [];
    2122  public request: IPharmacyHeadRequest;
    22   public token: string;
    2323
    24   constructor(private dataService: DataService, private dialog: MatDialog, private snackBar: MatSnackBar, private router: Router, private route: ActivatedRoute) {
     24  constructor(private dataService: DataService, private authService: AuthService, private dialog: MatDialog, private snackBar: MatSnackBar, private router: Router, private route: ActivatedRoute) {
    2525
    2626  }
    2727
    2828  ngOnInit(): void {
    29     this.token = this.route.snapshot.params['token'];
    30     this.dataService.getPharmacyHead(this.token)
    31         .subscribe((hd: IPharmacyHead) => {
    32           this.head = hd;
    33         },
    34         (err: any) => console.log(err),
    35         () => console.log('Head data retrieved'));
    36 
     29    this.head = this.authService.headValue;
    3730    this.dataService.getPharmacies()
    3831        .subscribe((pharmacy: IPharmacy[]) => {
Note: See TracChangeset for help on using the changeset viewer.