import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { Historico } from '../models/historico.model';

@Injectable({
  providedIn: 'root'
})
export class HistoricoService {

  private apiUrl = 'http://localhost:8080';

  constructor(private http: HttpClient) { }

  getHistorico(idFuncionario: number): Observable<Historico[]> {
    return this.http.get<Historico[]>(`${this.apiUrl}/checkin/historico/${idFuncionario}`);
  }
}
