import { HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { environment } from '../../../../environments/environment';
import { DashboardStatisticsModel } from '../../model/dashboard/dashboard-statistics-model';
import { BaseHttpService } from '../http/base-http.service';

@Injectable()
export class DashboardService {

	private actionUrl: string;
	private headers: HttpHeaders;

	constructor(private http: BaseHttpService) {
		this.actionUrl = environment.Server + 'dashboard/';
	}

	getStatistics(): Observable<DashboardStatisticsModel> {
		return this.http.get<DashboardStatisticsModel>(this.actionUrl + 'getStatistics', { headers: this.headers });
	}

	getUserStatistics(): Observable<DashboardStatisticsModel> {
		return this.http.get<DashboardStatisticsModel>(this.actionUrl + 'me/getStatistics', { headers: this.headers });
	}
}
