2019-07-15 14:54:19 +00:00
|
|
|
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()
|
|
|
|
export class UserService {
|
|
|
|
constructor(public httpClient: HttpClient, public appConfig: AppConfig) {
|
2019-07-18 16:59:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ApiEndpoint() {
|
|
|
|
return this.appConfig.getConfig("apiEndPoint");
|
2019-07-15 14:54:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
getCurrentUser(): Observable<IUser> {
|
2019-07-18 16:59:42 +00:00
|
|
|
return this.httpClient.get<IUser>(`${this.ApiEndpoint()}/api/v1/currentuser`);
|
2019-07-15 14:54:19 +00:00
|
|
|
}
|
|
|
|
}
|