Ignore:
Timestamp:
10/30/20 02:04:06 (2 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/shared/data.service.ts

    r6f203af r993189e  
    1 import { Injectable, } from '@angular/core';
     1import { Injectable } from '@angular/core';
    22import { HttpClient, HttpErrorResponse } from '@angular/common/http';
    33
     
    9595
    9696
    97     getPandemic() : Observable<IPandemic[]> {
    98         return this.http.get<IPandemic[]>(this.basePandemicUrl)
     97    getPandemic() : Observable<IPandemic> {
     98        return this.http.get<IPandemic>(this.basePandemicUrl)
    9999                   .pipe(catchError(this.handleError));
    100100    }
     
    143143                        catchError(this.handleError)
    144144                   );
    145     }
    146     loginPharmacyHead(email: string, passwd: string) : Observable<any> {
    147         let postData = {email : email ,password :passwd};
    148         return this.http.post<any>(this.basePharmacyHead + '/login', postData)
    149                    .pipe(
    150                         map((data) => {
    151                             return data;
    152                         }),
    153                         catchError(this.handleError)
    154                     );
    155     }
    156     getPharmacyHead(id: string) : Observable<IPharmacyHead> {
    157         return this.http.get<IPharmacyHead>(this.basePharmacyHead + '/' + id)
    158                    .pipe(catchError(this.handleError));
    159145    }
    160146    //PharmacyHead POST
Note: See TracChangeset for help on using the changeset viewer.