import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { environments } from '../../../../environments/environments';
import { catchError, map, throwError } from 'rxjs';

@Injectable({
  providedIn: 'root'
})
export class recibirRespuestas {
  private URL: string = environments.baseUrl;
  private getHeaders(): HttpHeaders {
    const token = localStorage.getItem('token') || '';
    return new HttpHeaders({
      'Content-Type': 'application/json',
      'Authorization': `Bearer ${token}`
    });
  }
  constructor(private http: HttpClient) { }


    recibirRespuesta(data: any) {
      return this.http.post(`${this.URL}/recibirRespuesta`, data,  { headers: this.getHeaders() });
    }
}
