Ignore:
Timestamp:
11/14/20 12:27:30 (4 years ago)
Author:
DimitarSlezenkovski <dslezenkovski@…>
Branches:
master
Children:
68454c6
Parents:
ad60966
Message:

Fix bugs, add some more

Location:
Farmatiko/ClientApp/src/app/shared
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Farmatiko/ClientApp/src/app/shared/data.service.ts

    rad60966 r1db5673  
    66
    77import { IHealthFacilities, IHealthcareWorkers, IMedicine, IPandemic, IPharmacy, IPharmacyHead, IPharmacyHeadRequest } from './interfaces';
     8import { environment } from '../../environments/environment';
    89
    910@Injectable()
    1011export class DataService {
    11     baseFacilitiesUrl: string = '/api/facilities';
    12     baseWorkersUrl: string = '/api/workers';
    13     baseMedicineUrl: string = '/api/medicines';
    14     basePandemicUrl: string = '/api/pandemic';
    15     basePharmacyUrl: string = '/api/pharmacy';
    16     basePharmacyHead: string = '/api/pharmacyhead';
     12    baseFacilitiesUrl: string = `${environment.baseApiUrl}api/facilities`;
     13    baseWorkersUrl: string = `${environment.baseApiUrl}api/workers`;
     14    baseMedicineUrl: string = `${environment.baseApiUrl}api/medicines`;
     15    basePandemicUrl: string = `${environment.baseApiUrl}api/pandemic`;
     16    basePharmacyUrl: string = `${environment.baseApiUrl}api/pharmacy`;
     17    basePharmacyHead: string = `${environment.baseApiUrl}api/pharmacyhead`;
    1718
    1819    constructor(private http: HttpClient) {
     
    179180    //PharmacyHead PUT
    180181    updatePharmacyHead(head: IPharmacyHead) : Observable<IPharmacyHead> {
    181         return this.http.put<IPharmacyHead>(this.basePharmacyHead + '/' + head.id, head)
     182        return this.http.put<IPharmacyHead>(this.basePharmacyHead, head)
    182183                   .pipe(
    183184                        map((data) => {
  • Farmatiko/ClientApp/src/app/shared/interfaces.ts

    rad60966 r1db5673  
    5757    originalUserName?: string;
    5858    Role?: string;
    59 
    60 
     59}
    6160export interface IPharmacyHeadRequest {
    6261    id?: string;
  • Farmatiko/ClientApp/src/app/shared/services/auth.service.ts

    rad60966 r1db5673  
    99
    1010interface LoginResult {
    11   username: string;
     11  userName: string;
    1212  role: string;
    1313  originalUserName?: string;
     
    3636        this.http.get<LoginResult>(`${this.apiUrl}/user`).subscribe((x) => {
    3737          this._user.next({
    38             Email: x.username,
     38            Email: x.userName,
    3939            Passwd: x.head.Passwd,
    4040            Role: x.role,
     
    6464        map((x) => {
    6565          this._user.next({
    66             Email: x.username,
     66            Email: x.userName,
    6767            Passwd: x.head.Passwd,
    6868            Role: x.role,
     
    105105        map((x) => {
    106106          this._user.next({
    107             Email: x.username,
     107            Email: x.userName,
    108108            Passwd: x.head.Passwd,
    109109            Role: x.role,
Note: See TracChangeset for help on using the changeset viewer.