import { Injectable } from '@angular/core';
import { environments } from '../../environment/environment';
import { HttpClient } from '@angular/common/http';
import { map, filter } from 'rxjs';

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

  getProducts() {
    return this.http.get(`${this.URL}/products`);
  }
  getProductCategory(categoria: any){
    // console.log(this.URL + "/buscar/" + categoria);
    return this.http.get(`${this.URL}/buscar/${categoria}`);
    
  }
  postSendMail(strBoddy: any) {
    return this.http.post(`${this.URL}/sendMail`, strBoddy);
  }
}
