import { HttpClient } from '@angular/common/http';
import { Injectable, inject } from '@angular/core';
import { Observable } from 'rxjs';
import { environment } from '../../../environments/environment';
import { TeamOverviewStats } from '../../models/team-stats.model';

@Injectable({ providedIn: 'root' })
export class TeamStatsApi {
  private readonly http = inject(HttpClient);

  loadStats(teamId: number): Observable<TeamOverviewStats> {
    return this.http.get<TeamOverviewStats>(`${environment.apiUrl}teams/${teamId}/overview/stats`);
  }
}
