22 lines
572 B
TypeScript
22 lines
572 B
TypeScript
import { Injectable } from '@angular/core';
|
|
import { Observable } from 'rxjs';
|
|
import { IUser } from '../models/user';
|
|
import { HttpClient } from "@angular/common/http";
|
|
import { AppConfig } from "../shared/app.config";
|
|
|
|
@Injectable({
|
|
providedIn: 'root',
|
|
})
|
|
export class UserService {
|
|
constructor(public httpClient: HttpClient, public appConfig: AppConfig) {
|
|
}
|
|
|
|
ApiEndpoint() {
|
|
return this.appConfig.getConfig("apiEndPoint");
|
|
}
|
|
|
|
getCurrentUser(): Observable<IUser> {
|
|
return this.httpClient.get<IUser>(`${this.ApiEndpoint()}/api/v1/currentuser`);
|
|
}
|
|
}
|