import { Injectable } from "@angular/core";
import { environments } from "../../../../environments/environments";
import { HttpClient, HttpHeaders } from '@angular/common/http';

@Injectable({
    providedIn: 'root'
  })
export class consultarRegistroService{
    private URL: string = environments.baseUrl;

    constructor(private _http: HttpClient) { }

    private getHeaders(): HttpHeaders {
        const token = localStorage.getItem('token') || '';
        return new HttpHeaders({
          'Content-Type': 'application/json',
          'Authorization': `Bearer ${token}`
        });
      }

    getConsultarRegistro(){
       return  this._http.get(`${this.URL}/alumnosRegistro`, { headers: this.getHeaders() });
    }
}